AdguardTeam / PopupBlocker

Popup blocking userscript
GNU Lesser General Public License v3.0
337 stars 31 forks source link

Display an alternative UI when the options page does not detect a userscript #106

Closed theseanl closed 4 years ago

ameshkov commented 6 years ago

@seanl-adg

  1. @kaprielov needs an instruction on how to test the userscript build and how to see the options page.
  2. We need a dev build compatible with tampermonkey/violentmonkey. The current one is compatible with AG for Win, but it's inconvenient to test it on Mac since there's no userscripts support (yet).

@kaprielov

  1. Add a simple footer to the settings page with just two links (Homepage (leads to github) and (c) AdGuard (leads to adguard.com))
  2. Here is a mockup for the "userscript not detected" state: https://uploads.adguard.com/up04_x7u9l_Userscripts_-_03._Settings_No_Userscript__Moqups.png
  3. @seanl-adg for the first 500 ms when detection is in progress use a simple stub: https://uploads.adguard.com/up04_h6stu_Userscripts_-_03._Settings_No_Userscript__Moqups.png
theseanl commented 6 years ago

We need a dev build compatible with tampermonkey/violentmonkey

It is compatible with tampermonkey/violentmonkey.

Here is a simple instruction:

  1. npm install -g http-server

  2. gulp travis

  3. http-server build

  4. Go to http://127.0.0.1:8080/popupblocker.user.js, then TM will offer a userscript installation.

  5. To test the options page, you need to manually edit a line

    return location.href === 'https://adguardteam.github.io/PopupBlocker/options.html';

    in a function body of isOptionsPage to smth like

    return location.href === 'https://adguardteam.github.io/PopupBlocker/options.html' || location.host === '127.0.0.1:8080';

    or whatever suits your environment.

  6. Then the options page at http://127.0.0.1:8080/options.html will detect the userscript.

theseanl commented 6 years ago

Fixed by https://github.com/AdguardTeam/PopupBlocker/commit/c77637aac61ab63792df59939fe36b975311cdd8