Tampermonkey / tampermonkey

Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.17k stars 416 forks source link

[ERROR] About tampermonkey beta runtime error #2152

Open waahah opened 1 month ago

waahah commented 1 month ago

An error occurred in installation script:

Unchecked runtime.lastError: The page keeping the extension port is moved into back/forward cache, so the message channel is closed.

This error occurs every time a script is installed, and sometimes another error occurs:

Uncaught (in promise) Error: No tab with id: 693405998.

For example: https://github.com/Tampermonkey/tampermonkey/issues/2138

Suggest

Disable bfcache and roll back the Enhanced back/forward cache navigation handling function

Because the browser suspends any pending timer or unresolved promise for the page in bfcache (including almost all pending tasks in the JavaScript task queue) and continues processing tasks after the page recovers from bfcache. This may affect other open tabs in the same source. As a result, browsers typically do not try to cache pages when using apis that might affect other pages during messaging processing.

Specifications

derjanb commented 1 month ago

What is the bug besides these console logs? Tampermonkey should detect if a page is moved in bfcache and restore communication when it is moved out of it.

waahah commented 1 month ago

In addition to the above error, no other error has been found,but I think the above problem is a universal one 屏幕截图 2024-08-09 234923

derjanb commented 1 month ago

Unchecked runtime.lastError: The page keeping the extension port is moved into back/forward cache

Where exactly do you see this message? In the console of the script installation page? Can you maybe post a screenshot? Do you need to do special things to make it appear?

waahah commented 1 month ago

From greasyfork when I click on the install script button, link to jump to https://www.tampermonkey.net/script_installation.php#url=, Service Worker will be output in the above error

屏幕截图 2024-08-12 160103

carcigenicate commented 1 month ago

I suddenly started getting this error as well:

image

I'm not sure what the trigger was since I noticed it after doing a bunch of stuff. It doesn't reliably trigger if I do forward/back navigation though. I also didn't noticed any erroneous behavior.

derjanb commented 1 month ago

I also didn't noticed any erroneous behavior.

Yes, this is just a cosmetic problem.

derjanb commented 2 weeks ago

Should be fixed at 5.3.6208 (crx|xpi in review)

Please download the crx file linked above and drag and drop it to the extensions page chrome://extensions (after you've enabled 'Developer Mode').

For a quick fix please export your settings and scripts as zip or (JSON) file at the "Utilities" tab and import it back at the fixed BETA version.