userscripts icon indicating copy to clipboard operation
userscripts copied to clipboard

Deprecate `@include` and `@exclude` metadata

Open ACTCD opened this issue 1 year ago • 11 comments

We will deprecate @include and @exclude and only support @match and @exclude-match in the future.

We plan to add a deprecation hint in v5 and eventually remove it in v6.0.

ACTCD avatar May 01 '24 01:05 ACTCD

Hi @ACTCD , Google search engine has hundreds of national domain names, use @include *://*.Google.* can match all national domain names, But, how to achieve wildcard through @match?

F9y4ng avatar Jul 18 '24 08:07 F9y4ng

Hi @F9y4ng, The @include *://*.Google.* will also match:

https://example.com/1.google.html
https://example.com/?site=www.google.com
https://1.google.example.com/
...

Obviously these are not your intentions, and may cause all kinds of damage.

That's why we want to make the change, to encourage developers to make more secure and accurate user scripts.

For your question, here is a userscript for Google, you can refer to its implementation: ACT.Google.DM.NCR.user.js

Hope this explains your question and satisfies you. Stay safe! :)

ACTCD avatar Jul 18 '24 16:07 ACTCD

Maybe I have to adopt your scheme after the browser forces to MV3. 😅

Thanks for your reply.

F9y4ng avatar Jul 18 '24 17:07 F9y4ng