Fix support Brave Browser

Referer for blocking external Javascript.
master
magnolia1234 2020-05-31 08:57:15 +02:00
parent de10b1f8ca
commit 0bc601c441
2 changed files with 5 additions and 3 deletions

View File

@ -28,13 +28,12 @@ The following instructions are needed to install third-party extensions in [Chro
1. Install [Yandex Browser](https://play.google.com/store/apps/details?id=com.yandex.browser&hl=en) from the Google PlayStore (Bypass Paywalls Clean doesn't work with Kiwi Browser yet).
2. Follow Chrome instructions located just above (step 6: pick `manifest.json` instead of the folder).
#### Other Chromium browsers (Opera/Vivaldi/Yandex)
#### Other Chromium browsers (Opera/Vivaldi/Brave/Yandex)
1. Download the extension as a .crx file from the [download page](https://bitbucket.org/magnolia1234/bypass-paywalls-chrome-clean/downloads).
2. In your browser go to the extensions page.
3. Enable Developer Mode.
4. Drag your .crx file anywhere on the page to import it.
5. If dragging crx does not work, try Chrome procedure (above).
* Brave Browser doesn't support specific blocking of external paywall-scripts (referer of main site isn't available in Javascript)
5. If dragging crx does not work, try Chrome procedure (above).
#### Firefox
Visit the [Firefox repository](https://bitbucket.org/magnolia1234/bypass-paywalls-firefox-clean) of Bypass Paywall Clean.

View File

@ -388,6 +388,9 @@ ext_api.webRequest.onBeforeSendHeaders.addListener(function(details) {
continue;
}
}
// fix brave browser
if (!details.originUrl && !header_referer.includes(details.initiator))
header_referer = details.initiator;
// remove cookies for sites medium platform (mainfest.json needs in permissions: <all_urls>)
var medium_custom_domain = (isSiteEnabled({url: 'https://medium.com'}) && matchUrlDomain('cdn-client.medium.com', details.url) && !matchUrlDomain('medium.com', header_referer));