Kevin R
2025-01-29 20:24:38 +01:00
parent 308a2f1579
commit d8da43ac29
3 changed files with 65 additions and 13 deletions

View File

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

View File

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

View File

@@ -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"
], ],