Closed odnar-dev closed 3 years ago
Have you tested the 2 scenarios I mentioned there? https://github.com/useful-forks/useful-forks.github.io/pull/21#issuecomment-802530653
Have you tested the 2 scenarios I mentioned there? #21 (comment)
yes
The manifest.json
config change from "*://github.com/*/network/members"
to "*://github.com/*/*"
: would you mind explaining why that is necessary ? I thought keeping the matches
as restrictive as possible would be the best.
I tried your changes with "*://github.com/*/network/members"
, for example, and the init()
function still gets called when I open Dependencies and Network pages. I think there is something I don't understand about this content_script
's matches
value.
when you go to Dependencies then click on Forks it look like the whole page changed but what actually happened is that :
history.pushstat
i added an event listeners that monitor pjax requests then call init()
after it ended.
document.addEventListener('pjax:end', init);
the init()
function well check if current URL is "*://github.com/*/network/members"
then add css and run initial_request()
if (pathComponents[4] == "members"){...
chrome extensions normally doesnt monitor history.pushstat
so when you go to Forks from Dependencies page your extension didn't get enabled cause chrome still think you are in the Dependencies page
if you wanna keep the matches
as restrictive as possible you need to add every page that link to Forks page and use pjax
"matches": [
"*://github.com/*/*/community",
"*://github.com/*/*/graphs/*",
"*://github.com/*/*/network/*",
"*://github.com/*/*/pulse"
],
Okay, you explained it really well, thank you!
closes : https://github.com/useful-forks/useful-forks.github.io/issues/9