mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-15 21:55:36 +07:00
Changed google search rwt detection
Fixes:
- [#134](https://github.com/ClearURLs/Addon/issues/134)
- [#187](https://gitlab.com/ClearURLs/rules/-/issues/187)
- [#387](https://github.com/ClearURLs/Addon/issues/387)
- [#393](https://github.com/ClearURLs/Addon/issues/393)
- [#978](https://gitlab.com/ClearURLs/ClearUrls/-/issues/978)
- [#980](https://gitlab.com/ClearURLs/ClearUrls/-/issues/980)
- [#1301](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1301)
- [#1302](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1302)
- [#1305](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1305)
.
.
This commit is contained in:
23
CHANGELOG.md
23
CHANGELOG.md
@@ -15,6 +15,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Require Firefox >= 55
|
- Require Firefox >= 55
|
||||||
- Require Chrome >= 37
|
- Require Chrome >= 37
|
||||||
|
|
||||||
|
|
||||||
|
## [1.27.3] - 2025-XX-XX
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Google Search `window.rwt` detection
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Google Docs
|
||||||
|
- [#134](https://github.com/ClearURLs/Addon/issues/134)
|
||||||
|
- [#187](https://gitlab.com/ClearURLs/rules/-/issues/187)
|
||||||
|
- [#387](https://github.com/ClearURLs/Addon/issues/387)
|
||||||
|
- [#393](https://github.com/ClearURLs/Addon/issues/393)
|
||||||
|
- [#978](https://gitlab.com/ClearURLs/ClearUrls/-/issues/978)
|
||||||
|
- [#980](https://gitlab.com/ClearURLs/ClearUrls/-/issues/980)
|
||||||
|
- [#1301](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1301)
|
||||||
|
- [#1302](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1302)
|
||||||
|
- [#1305](https://gitlab.com/ClearURLs/ClearUrls/-/issues/1305)
|
||||||
|
|
||||||
|
|
||||||
|
### Compatibility note
|
||||||
|
- Require Firefox >= 55
|
||||||
|
- Require Chrome >= 37
|
||||||
|
|
||||||
## [1.27.2] - 2025-01-27
|
## [1.27.2] - 2025-01-27
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -26,19 +26,36 @@
|
|||||||
|
|
||||||
function injectFunction() {
|
function injectFunction() {
|
||||||
let ele = document.createElement('script');
|
let ele = document.createElement('script');
|
||||||
let s = document.getElementsByTagName('script')[0];
|
|
||||||
if (s === undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ele.type = 'text/javascript';
|
ele.type = 'text/javascript';
|
||||||
ele.textContent = "Object.defineProperty(window, 'rwt', {" +
|
ele.textContent = `
|
||||||
" value: function() { return true; }," +
|
(function() {
|
||||||
" writable: false," +
|
"use strict";
|
||||||
" configurable: false" +
|
|
||||||
"});";
|
${hookRwtProperty.toString()}
|
||||||
|
|
||||||
s.parentNode.insertBefore(ele, s);
|
const rwtDescriptor = Object.getOwnPropertyDescriptor(window, 'rwt');
|
||||||
|
if (!('rwt' in window) || (rwtDescriptor && rwtDescriptor.configurable)) {
|
||||||
|
hookRwtProperty();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
`;
|
||||||
|
|
||||||
|
let s = document.getElementsByTagName('script')[0];
|
||||||
|
if (s !== undefined) {
|
||||||
|
s.parentNode.insertBefore(ele, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hookRwtProperty() {
|
||||||
|
try {
|
||||||
|
Object.defineProperty(window, 'rwt', {
|
||||||
|
configurable: false,
|
||||||
|
writable: false,
|
||||||
|
value: function() { return true; }
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.debug('ClearURLs: Failed to hook rwt property', e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -65,6 +82,6 @@
|
|||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
})(window);
|
})(window);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "ClearURLs",
|
"name": "ClearURLs",
|
||||||
"version": "1.27.2",
|
"version": "1.27.3",
|
||||||
"author": "Kevin Roebert",
|
"author": "Kevin Roebert",
|
||||||
"description": "__MSG_extension_description__",
|
"description": "__MSG_extension_description__",
|
||||||
"homepage_url": "https://docs.clearurls.xyz",
|
"homepage_url": "https://docs.clearurls.xyz",
|
||||||
@@ -270,6 +270,18 @@
|
|||||||
"*://*.google.co.zw/*",
|
"*://*.google.co.zw/*",
|
||||||
"*://*.google.cat/*"
|
"*://*.google.cat/*"
|
||||||
],
|
],
|
||||||
|
"include_globs": [
|
||||||
|
"http?://www.google.*/",
|
||||||
|
"http?://www.google.*/#hl=*",
|
||||||
|
"http?://www.google.*/search*",
|
||||||
|
"http?://www.google.*/webhp?hl=*",
|
||||||
|
"https://encrypted.google.*/",
|
||||||
|
"https://encrypted.google.*/#hl=*",
|
||||||
|
"https://encrypted.gogole.*/search*",
|
||||||
|
"https://encrypted.google.*/webhp?hl=*",
|
||||||
|
"http?://ipv6.google.com/",
|
||||||
|
"http?://ipv6.google.com/search*"
|
||||||
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"core_js/google_link_fix.js"
|
"core_js/google_link_fix.js"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user