Overrides window.top to return window itself
// ==UserScript==
// @name qwen Override window.top Getter
// @description Overrides window.top to return window itself
// @match *://*/*
// @run-at document-start
// @version 0.0.1.20250529080758
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==
(function() {
Object.defineProperty(window, 'top', {
get: function() { return window.self; },
configurable: true
});
Object.defineProperty(window, 'frameElement', {
get: function() { return null; },
configurable: true
});
Object.defineProperty(window.location, 'ancestorOrigins', {
get: function() { return []; },
configurable: true
});
})();