Skip to content

Add support for geoportal.sgb.gov.br to Auto-Aceite LGPD userscript#6

Merged
nelisjunior merged 1 commit intomainfrom
copilot/fix-0aa5eb9b-1e1b-4b86-8fbe-f5a5b70fbff0
Jul 2, 2025
Merged

Add support for geoportal.sgb.gov.br to Auto-Aceite LGPD userscript#6
nelisjunior merged 1 commit intomainfrom
copilot/fix-0aa5eb9b-1e1b-4b86-8fbe-f5a5b70fbff0

Conversation

Copy link
Contributor

Copilot AI commented Jul 2, 2025

Adds automatic checkbox acceptance functionality for the geoportal.sgb.gov.br site to the existing userscript, maintaining full compatibility with SIGMINE and geoanp sites.

Changes Made

🚀 New Features

  • Added geoportal.sgb.gov.br support: Automatically detects and clicks the "Não mostrar esta tela de abertura novamente" checkbox
  • Smart selector: Uses .confirmcheck-container [role="checkbox"] to locate the custom checkbox element
  • Conditional execution: Only clicks when aria-checked="false" to avoid unnecessary interactions

🔧 Technical Updates

  • Added @match *://geoportal.sgb.gov.br/* to userscript header
  • Updated version from 0.1-beta to 0.2-beta
  • Enhanced description to reflect broader scope: "SIGMINE (ANM), geoanp (ANP) e geoportal (SGB)"
  • Added dedicated logging: ✅ Checkbox geoportal SGB clicada

📚 Documentation Updates

  • Updated README.md files to include geoportal functionality
  • Added new automation section for Geoportal SGB in userscripts/README.md
  • Updated changelog with v0.2-beta release notes
  • Expanded justification to cover all three supported sites

✅ Testing

Successfully tested the new functionality with a custom test environment:

Test Results

Test confirms:

  • ✅ Correct checkbox detection using the specified selector
  • ✅ Proper aria-checked="false" validation before clicking
  • ✅ Successful state change from unchecked (☐) to checked (☑)
  • ✅ Debug logging working as expected
  • ✅ No interference with existing SIGMINE and geoanp functionality

🛡️ Backward Compatibility

  • 100% compatible with existing SIGMINE (geo.anm.gov.br) functionality
  • 100% compatible with existing geoanp (geomaps.anp.gov.br) functionality
  • All existing selectors and logic remain unchanged
  • Only additive changes - no modifications to working code

Code Structure

The implementation follows the established pattern:

// Caso geoportal - SGB
const geoportalCheckbox = document.querySelector('.confirmcheck-container [role="checkbox"]');
if (geoportalCheckbox && geoportalCheckbox.getAttribute('aria-checked') === 'false') {
    geoportalCheckbox.click();
    console.log('✅ Checkbox geoportal SGB clicada');
}

This maintains the same robust approach used for the other sites while addressing the specific requirements for geoportal.sgb.gov.br.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@nelisjunior nelisjunior marked this pull request as ready for review July 2, 2025 23:18
@nelisjunior nelisjunior merged commit ab32286 into main Jul 2, 2025
1 check passed
@nelisjunior nelisjunior deleted the copilot/fix-0aa5eb9b-1e1b-4b86-8fbe-f5a5b70fbff0 branch July 2, 2025 23:19
Copilot AI restored the copilot/fix-0aa5eb9b-1e1b-4b86-8fbe-f5a5b70fbff0 branch July 2, 2025 23:19
Copilot AI changed the title [WIP] Suporte ao Geoportal SGB no userscript de aceite automático Add support for geoportal.sgb.gov.br to Auto-Aceite LGPD userscript Jul 2, 2025
Copilot AI requested a review from nelisjunior July 2, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants