討論 » 開發

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://greasyforks.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.

§
發表於:2025-03-22
編輯:2025-03-22

For "embedded" you mean sites loaded as IFrames, such as youtube videos when they are loaded inside another page?

Exactly the scenario.

https://greasyforks.org/en/scripts/32-show-password-onmouseover/discussions/4020#comment-583816

ahh so that means modifying the scripts. Okay I'll do it manually, but also put in requests to the individual authors to include that 'isEmbedded' code.

發表回覆

登入以回復

长期地址
遇到问题?请前往 GitHub 提 Issues。