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

bug: After upgrading to manifest v3 Chrome notification not sent anymore due to this error Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist. #10

Closed
eric60 opened this issue May 26, 2024 · 1 comment

Comments

@eric60
Copy link
Owner

eric60 commented May 26, 2024

  • PROBLEM: After upgrading to manifest v3 Chrome notification not sent anymore due to these errors
  • Error: Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
  • Error: Unchecked runtime.lastError: The message port closed before a response was received.
  • Tried to fix with this solution but did not work
@eric60
Copy link
Owner Author

eric60 commented May 27, 2024

Problem

  • Error: Error in event handler: ReferenceError: Cannot access 'message' before initialization

Solution

  • first had to send chrome.runtime.sendMessage before updating the window to fix the previous error Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist. and Error: Unchecked runtime.lastError: The message port closed before a response was received.
  • then had to remove block scoped variables to use the local scoped variables for the message object
  • before was mixing and matching variables which caused message to be undefined
Pasted Graphic

eric60 added a commit that referenced this issue May 27, 2024
* Fix Error 1) error Unchecked runtime.lastError: The message port closed before a response was received. and
* Fix Error 2) Error in event handler: ReferenceError: Cannot access 'message' before initialization
eric60 added a commit that referenced this issue May 27, 2024
* update instructions to be clearer

* ad youtubeBlocker_ prefix to all files to make easier to debug in chrome

* Update manifest.json

* fix: fix chrome notifications not being sent (#10)

* Fix Error 1) error Unchecked runtime.lastError: The message port closed before a response was received. and
* Fix Error 2) Error in event handler: ReferenceError: Cannot access 'message' before initialization
@eric60 eric60 closed this as completed May 27, 2024
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

No branches or pull requests

1 participant