Fix #233: Add missing "common.js" load for "/account/licenses"#234
Fix #233: Add missing "common.js" load for "/account/licenses"#234smiley wants to merge 1 commit into
Conversation
…ses" `scripts/store/account_licenses.js` uses `GetOption(...)` in `scripts/common.js` but doesn't reference it in its script embed section. While `common.js` is injected generally for all pages under `https://store.steampowered.com/*`, looks like it's not there by the time `GetOption(...)` is called. This settles the race condition.
|
It is referenced by an earlier declaration. This seems like a chrome bug where scripts are injected in wrong order sometimes (I've tried to fix it by adding a timeout). Does restarting the browser fix it for you? Like I think this is a Chromium bug that they load in the wrong order, but only sometimes. for example mozilla documents that: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#load_order |
|
Sorry for the delay, looks like the change in c7ac4d6 also works around it. And no, restarting the browser, force updating or force reloading the extension didn't fix it, however now it's magically "fixed" after fiddling with the unpacked extension and going back to the store extension... |
|
Actually, now that I think about it -- if the entire script is in |
|
I would hope even with timeout 0 it would run before document end |
|
But if all of the functionality runs at DOMContentLoaded anyway, wouldn't it be the same as |
|
The injected script runs earlier though. |
|
Oh, right, that solution is fine then |
|
I did make https://issues.chromium.org/issues/443106939 |
scripts/store/account_licenses.jsusesGetOption(...)inscripts/common.jsbut doesn't reference it in its script embed section. Whilecommon.jsis injected generally for all pages underhttps://store.steampowered.com/*, looks like it's not there by the timeGetOption(...)is called. This settles the race condition. (Tested locally in Developer Mode on Microsoft Edge 139.0.3405.125)