Redirect Google AMP cache (opt-in to custom sites)

merge-requests/8/head
magnolia1234 2 years ago
parent bcface1f1e
commit 42bd3ea308

@ -489,6 +489,20 @@ ext_api.webRequest.onBeforeRequest.addListener(function (details) {
["blocking"]
);
// Google AMP cache redirect
ext_api.webRequest.onBeforeRequest.addListener(function (details) {
var url = details.url.split('?')[0];
var updatedUrl;
if (matchUrlDomain('cdn.ampproject.org', url))
updatedUrl = 'https://' + url.split(/cdn\.ampproject\.org\/[a-z]\/s\//)[1];
else if (matchUrlDomain('google.com', url))
updatedUrl = 'https://' + url.split(/\.google\.com\/amp\/s\//)[1];
return { redirectUrl: decodeURIComponent(updatedUrl) };
},
{urls:["*://*.cdn.ampproject.org/*/s/*", "*://*.google.com/amp/s/*"], types:["main_frame"]},
["blocking"]
);
// inkl bypass
ext_api.webRequest.onBeforeRequest.addListener(function (details) {
if (!isSiteEnabled(details)) {

@ -3,6 +3,7 @@ Changelog Bypass Paywalls Clean - Firefox
Post-release
Add Tagesspiegel.de
Redirect Google AMP cache (opt-in to custom sites)
* v2.7.8.0 (2022-07-31)
Add Crusoe (Brazil)

Loading…
Cancel
Save