Deprecate `@include` and `@exclude` metadata
We will deprecate @include and @exclude and only support @match and @exclude-match in the future.
- Match pattern structure is safer and stricter, not too many accidents happen.
- It reduces code logic, and may helps improve matching efficiency.
- In the Web Extension API,
include_globsandexclude_globs- Only support
globsinstead of regular expressions. - And Apple never implement these keys in Safari.
- The newer API
scripting.RegisteredContentScriptno longer supports these keys.
- Only support
- Reduce confusion and difficult choices caused by different syntaxes.
We plan to add a deprecation hint in v5 and eventually remove it in v6.0.
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?
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! :)
Maybe I have to adopt your scheme after the browser forces to MV3. 😅
Thanks for your reply.