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

master
magnolia1234 2022-08-01 19:08:18 +02:00
parent 620abe2dc0
commit 723e5d29ba
2 changed files with 15 additions and 0 deletions

View File

@ -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)) {

View File

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