🏠 Home 

讨论 » 开发

Generic user-exclusion for embeds

§
发表于:2025-03-21
编辑于:2025-03-21

Just a request for info: I'ld hoping for a regex that can be added as a User-Exclude for certain scripts so that they do not trigger when an embedded object is found.

I'm currently using the one pointed in https://greasyfork.org/forum/discussion/71798/small-bug-with-embedded, but most sites nowadays are developed to avoid falling for such an easy filtering trap.

I wonder if a regex can be used, rather than manually modifying the scripts.

StephenP管理员
§
发表于:2025-03-22

For "embedded" you mean sites loaded as IFrames, such as youtube videos when they are loaded inside another page?
If so, you can compare if the window where the script is loaded is non the top window:

if (window.top == window.self)
return;

In this case, the script will be loaded both in main windows or in iframes, but it will actually run only if it's loaded in the top window.

发表回复

登录以发表回复。