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

Mutation observer needs to be disconnected if the extension is reloaded #131

Closed
matatk opened this issue Jan 6, 2018 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@matatk
Copy link
Owner

matatk commented Jan 6, 2018

This only appears to affect Chrome (and presumably Opera).

Uncaught Error: Invocation of form runtime.connect(null, ) doesn't match definition runtime.connect(optional string extensionId, optional object connectInfo)
    at Object.normalizeArgumentsAndValidate (VM34 extensions::schemaUtils:115)
    at Object.<anonymous> (VM29 extensions::binding:363)
    at Object.<anonymous> (VM38 extensions::runtime:56)
    at Object.handleRequest (VM29 extensions::binding:64)
    at Object.<anonymous> (VM29 extensions::binding:374)
    at sendUpdateBadgeMessage (content.management.js:94)
    at findLandmarksAndUpdateBadge (content.management.js:102)
    at content.management.js:144
    at PauseHandler.run (content.pauseHandler.js:99)
    at MutationObserver (content.management.js:141)

Looks like sendMessage() is unable to work as there's no longer a connection as we are now an outdated content script. #61 has some info on what could be done that, if it works on Firefox, could be used as a general solution for both issues. If not, this one may best be solved by trapping this error and de-registering the mutation observer.

@matatk matatk added the bug label Jan 6, 2018
@matatk matatk self-assigned this Jan 6, 2018
@matatk matatk added this to the 2.1.1 milestone Jan 8, 2018
matatk added a commit that referenced this issue Jan 12, 2018
* Remove unused translation message.
* Simplify LandmarksFinder API and rename functions for clarity (they
  are getters). This fixes a bug that was there for ages whereby it was
  not calling the function to check the number of landmarks found (in
  checkFocusElement()).
* Vastly simplify the bootstrapping code in content.overall.js.
* Move Logger to content.overall.js from content.pausing.js and
  generalise.
* Remove Logger from content.pausing.js.
* Disconnect observer if content script has been retired (fixes #131).
matatk added a commit that referenced this issue Jan 18, 2018
* Remove unused translation message.
* Simplify LandmarksFinder API and rename functions for clarity (they
  are getters). This fixes a bug that was there for ages whereby it was
  not calling the function to check the number of landmarks found (in
  checkFocusElement()).
* Vastly simplify the bootstrapping code in content.overall.js.
* Move Logger to content.overall.js from content.pausing.js and
  generalise.
* Remove Logger from content.pausing.js.
* Disconnect observer if content script has been retired (fixes #131).
@matatk matatk closed this as completed in 5759b72 Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant