Inhaltsverzeichnis Vorheriger Eintrag (api:GM_xmlhttpRequest) Nächster Eintrag (api:GM_cookie.list)
Note: this API is experimental and might change at any time. It is also not available anymore at Manifest v3 versions of Tampermonkey 5.2+ (Chrome and derivates).
GM_webRequest (re-)registers rules for web request manipulations and the listener of triggered rules.
If you need to just register rules it's better to use @webRequest header.
Note, webRequest proceeds only requests with types sub_frame, script, xhr and websocket.
{ include: [selector] }, object properties:"cancel" is shortening for { cancel: true }, object properties:"([^:]+)://match.me/(.*)";"$1://redirected.to/$2";"cancel", "redirect";"ok" or "error";GM_webRequest([
{ selector: '*cancel.me/*', action: 'cancel' },
{ selector: { include: '*', exclude: 'http://exclude.me/*' }, action: { redirect: 'http://new_static.url' } },
{ selector: { match: '*://match.me/*' }, action: { redirect: { from: '([^:]+)://match.me/(.*)', to: '$1://redirected.to/$2' } } }
], function(info, message, details) {
console.log(info, message, details);
});