Closed dhowe closed 7 years ago
For this case content-script didn't get the chance to be injected into the current page. Once the user refresh the page it should be fine.
If we want the page to be redacted without manual refreshing in this case, it should Option 1: Renew all tabs on install/enabled?(not sure how to detect this) But this doesn't sound good to me when the user has many tabs open.
Option 2 Ideally it should refresh the page if the page is 1.current page 2.if ChinaEye has never ran "checkPage" on this page(firstInstall/reenabled...) when getBlockingStatus request is made from popup and there is no status for the tabId in localStorage(Not sure whether this is precise enough...)
Are these the steps when menu is opened?
Question: could this happen at other times, beside install or re-enable ?
Content-script is injected whenever a new page is loaded, this is separated from popup and will also ask extension to checkPage.
The core issue here is redacted style don't get injected into the page. Besides install and re-enable, which is the case when the whole content-script is not injected to the page, it could also be the following scenario: A page which is used to be allowed by the server, got failing result after recheck. In this case, since the page was not redacted before, redacted style was not injected when content-script first loaded. For the later scenario, if rechecking server got a different blocking status compared with the previous one, the page should reload.
is there a reason not to send a reapplyStyle message to the content-script for these cases (maybe for v1.1)?
I see...yes, reapplyStyle message is better. I think it's better to do it for v1.0, as it influence the performance on first-install...
https://github.com/dhowe/ChinaEye/pull/63
To recreate: disable or uninstall extension, do google search, re-enable extension.
Icon shows that search is blocked, as does text, however not redacted.