window.__GRPCWEB_DEVTOOLS__ undefined from time to time
jackielii opened this issue · comments
The way devtools communicates with the current window is very brittle, and can easily loose connection; content script injection is not straight forward and I've not found a successful way to re-connect (other than just refreshing the browser window).
If this is causing more people issues, I'll take another look to see if we can improve this.
@rogchap today I looked a bit closer, the inject.js is executed, but always after the main.js, I can reproduce it consistently.
Sorry I think my original description is a bit miss leading. Somehow the AdBlock
extension made the content to load after the inject.js is executed...
I think I have figured it out, this link describes the problem: https://stackoverflow.com/questions/15730869/my-injected-script-runs-after-the-target-pages-javascript-despite-using-run
and I noticed the redux devtools always work , and apparently they use the same textContent
trick: https://github.com/zalmoxisus/redux-devtools-extension/blob/b3fed33edb58d6ca6bbea69785f36be69531f402/src/browser/extension/inject/pageScriptWrap.js#L4
Thanks for looking into this @jackielii
I’ll take a look and see what we can do to fix.