Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The extension inserts a duplicate recap banner and button to create an alert #318

Closed
ERosendo opened this issue Dec 8, 2022 · 1 comment · Fixed by freelawproject/recap-chrome#287
Assignees

Comments

@ERosendo
Copy link

ERosendo commented Dec 8, 2022

The extension inserts the banner and the button to create an alert even when those elements are already created on the docket query page. Here's a picture of the bug:

image

Problem

The issue appears to be related to the PACER.handleDocketQueryUrl() method. This method is called from content_delegate.js and inserts the elements after the request to get docket availability (getAvailabilityForDocket) is completed but there's no logic to check if the elements are already on the page, so if this method is called twice or more times it will keep inserting new banners to the body of the page.

Possible Solution

We could insert logic to check if the banners exist on the page and then remove the old ones to let the extension inserts the new ones. The logic should be something like this:

// get the banner on the page
let banners = document.querySelectorAll('.recap-banner')
// Remove all HTML elements that the extension inserted 
banners.forEach(banner => { banner.remove(); });
@ERosendo ERosendo self-assigned this Dec 8, 2022
@mlissner
Copy link
Member

mlissner commented Dec 9, 2022

Solution sounds good, thanks Eduardo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants