GoogleChrome / web-vitals-extension

A Chrome extension to measure essential metrics for a healthy site
https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma?hl=en
Apache License 2.0
2.35k stars 105 forks source link

DevTools bfcache tester incompatible with extension #117

Closed tunetheweb closed 1 year ago

tunetheweb commented 1 year ago

Describe the bug

When using the extension you get the following issue in the Dev Tools bfcache tester

Extensions with long-lived connection attempted to send messages to frames in back/forward cache. Extension id: ahfhijdlegdabablpippeagghigmibma

EmbedderExtensionSentMessageToCachedFrame

To Reproduce Turn on the extension on any page and do the bfcache test

Expected behavior A clear and concise description of what you expected to happen.

Version:

Additional context, screenshots, screencasts

I tried wrapping the broadcastMetricsUpdates in a check to see if page was hidden or frozen but testing that didn't solve the issue.

tunetheweb commented 1 year ago

Ah!! It CAN use the bfcache (though I think I have seen it block on occasion, but that may be in combination with other extensions? Or maybe I imagined it?).

However, it cannot use the DevTools test as it is not allowed to access chrome:// pages (for security reasons presumably?) and navigating to chrome://terms (and then back) is what bfcache devtools test does.

Tried a few things to prevent it trying to access this page but no luck so far. Will keep digging...

tunetheweb commented 1 year ago

Closed with #161 (mostly - can still trip up on rare occasions as a little racey).