🏠 返回首頁 

Greasy Fork is available in English.

Novinky.cz / Seznam.cz - Anti Tracking

Cleans and visits the original URL from Seznam.cz redirection and blocks specific URLs globally


安装此脚本?
// ==UserScript==
// @name         Novinky.cz / Seznam.cz -  Anti Tracking
// @namespace    FUSZN
// @version      0.5
// @description  Cleans and visits the original URL from Seznam.cz redirection and blocks specific URLs globally
// @author       Projekt Darkside - Brno city Bohemia
// @match        *://*/*
// @license      MIT
// @grant        none
// ==/UserScript==
(function() {
'use strict';
// List of URLs to block
const blockedUrls = [
"*://cmp.seznam.cz/*",
"*://a.iva.seznam.cz/*",
"*://share.seznam.cz/*",
"*://d795-a.sdn.cz/d_795/sl/1/stable/*",
"*://d50-a.sdn.cz/*",
"*://d39-a.sdn.cz/d_39/c_static_gZ_T/aZTBO/*",
"*://cmp.seznam.cz/*",
"*://*.seznam.cz/nastaveni-souhlasu/*",
"*://c.seznam.cz/*",
"*://trending.seznam.cz/*",
"*://suggest.seznam.cz/*",
"*://cm1.jhmt.cz/*",
"*://*.hit.gemius.pl/*"
];
// Function to block specific URLs
function blockUrls() {
const currentUrl = window.location.href;
for (let i = 0; i < blockedUrls.length; i++) {
const blockedUrl = blockedUrls[i].replace(/\*/g, '.*');
if (new RegExp(blockedUrl).test(currentUrl)) {
console.log(`Blocked URL: ${currentUrl}`);
document.body.innerHTML = '<h1>Blocked URL</h1>';
return;
}
}
}
// Function to clean and visit original URL
function cleanAndVisitOriginalUrl() {
const currentUrl = window.location.href;
const match = currentUrl.match(/return_url=([^&]*)/);
if (match) {
const originalUrl = decodeURIComponent(match[1]);
window.location.href = originalUrl;
}
}
// Function to block cookies
function blockCookies() {
// Override document.cookie setter
Object.defineProperty(document, 'cookie', {
get: function() {
return '';
},
set: function() {
console.log('Blocked cookie:', arguments);
},
configurable: true
});
// Clear existing cookies
document.cookie.split(";").forEach(function(cookie) {
document.cookie = cookie.replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
});
}
// Execute functions
blockUrls();
cleanAndVisitOriginalUrl();
blockCookies();
})();