dhowe / ChinaEye

Experience the web as if you were living in China...
Artistic License 2.0
9 stars 3 forks source link

On search page but no disable-search button #59

Closed dhowe closed 7 years ago

dhowe commented 7 years ago

image

are we checking the location of the current tab every time the menu is opened?

cqx931 commented 7 years ago

Every time the menu is open, it is getting the current tab id/url and try to find the blocking status of the current tag. Both this issue and https://github.com/dhowe/ChinaEye/issues/58 are caused by clicking recheck on blocked pages that are blocked by keyword and allowed by the servers.

The current way of setting getBlockStatus will overwrite all the information and since recheck button only checks the server, it will update the blockStatus to allow, which disables the whitelist buttons.

dhowe commented 7 years ago

This is pretty confusing -- do you have a solution in mind?

  1. Seems that even if you click 'recheck now', your settings should persist.
  2. On the case where the page/search is not disabled, the interface should look the same as if you had visited the page for the first time (no cache, etc.).
cqx931 commented 7 years ago

A quick and easy solution would be to call checkPage instead of checkServer when clicking "recheck now" button. Though it actually recheck everything instead of just the server.

A more proper fix would be to pass trigger(either from check search keyword or from existing BlockingStatus) to checkServer, and if trigger != undefined, status is block.

cqx931 commented 7 years ago

This should be fixed in the latest PR: https://github.com/dhowe/ChinaEye/pull/63, please check.