mirror of
https://github.com/SimonBrazell/privacy-redirect
synced 2025-02-08 15:58:53 +01:00
Update background.js
This commit is contained in:
parent
f483faad4a
commit
27736105d5
@ -129,12 +129,7 @@ const layers = {
|
||||
traffic: "S", // not implemented on OSM, default to standard.
|
||||
bicycling: "C",
|
||||
};
|
||||
const notPrivateSearchEngine = [
|
||||
"google.com",
|
||||
"google.co.jp",
|
||||
"www.google.com",
|
||||
"www.google.co.jp",
|
||||
];
|
||||
const googleSearchRegex = /https?:\/\/(((www|maps)\.)?(google\.).*(\/search)|search\.(google\.).*)/;
|
||||
const privateSearchEngine = [
|
||||
{ link: "https://duckduckgo.com", q: "/" },
|
||||
{ link: "https://startpage.com", q: "/search/" },
|
||||
@ -642,7 +637,7 @@ browser.webRequest.onBeforeRequest.addListener(
|
||||
redirect = {
|
||||
redirectUrl: redirectReddit(url, initiator, details.type),
|
||||
};
|
||||
} else if (notPrivateSearchEngine.includes(url.host)) {
|
||||
} else if (url.href.match(googleSearchRegex)) {
|
||||
redirect = {
|
||||
redirectUrl: redirectSearchEngine(url, initiator),
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user