mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Merge pull request #3003 from motemen/chrome-webrequest-requestfilter-types
Fix chrome.webRequest.RequestFilter.types
This commit is contained in:
commit
d5713b68db
@ -152,4 +152,25 @@ function printPage() {
|
||||
var action_url = "javascript:window.print();";
|
||||
chrome.tabs.update(tab.id, { url: action_url });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// https://developer.chrome.com/extensions/examples/extensions/catblock/background.js
|
||||
function catBlock () {
|
||||
var loldogs: string[];
|
||||
chrome.webRequest.onBeforeRequest.addListener(
|
||||
function(info) {
|
||||
console.log("Cat intercepted: " + info.url);
|
||||
// Redirect the lolcal request to a random loldog URL.
|
||||
var i = Math.round(Math.random() * loldogs.length);
|
||||
return {redirectUrl: loldogs[i]};
|
||||
},
|
||||
// filters
|
||||
{
|
||||
urls: [
|
||||
"https://i.chzbgr.com/*"
|
||||
],
|
||||
types: ["image"]
|
||||
},
|
||||
// extraInfoSpec
|
||||
["blocking"]);
|
||||
}
|
||||
|
||||
2
chrome/chrome.d.ts
vendored
2
chrome/chrome.d.ts
vendored
@ -2248,7 +2248,7 @@ declare module chrome.webRequest {
|
||||
|
||||
interface RequestFilter {
|
||||
tabId?: number;
|
||||
types?: string;
|
||||
types?: string[];
|
||||
urls: string[];
|
||||
windowId?: number;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user