-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
idleIssues and pull requests with no activity for three months.Issues and pull requests with no activity for three months.
Description
I tried to load the extension after clone the code from this link:
https://github.com/mdn/webextensions-examples/tree/master/http-response
After that I see the extension does not work, the domain example.com
is not used anymore.
The I tried to change the code to something like this:
function listener(details) {
let filter = browser.webRequest.filterResponseData(details.requestId);
let decoder = new TextDecoder("utf-8");
let encoder = new TextEncoder();
filter.ondata = event => {
let str = decoder.decode(event.data, {stream: true});
// Just change any instance of Example in the HTTP response
// to WebExtension Example.
str = str.replace(/^.*$/g, 'WebExtension Example');
filter.write(encoder.encode(str));
filter.disconnect();
}
return {};
}
browser.webRequest.onBeforeRequest.addListener(
listener,
{urls: ["https://google.com/*"], types: ["main_frame"]},
["blocking"]
);
But the extension still not work as expected.
Can you please take a look the problem for me?
Metadata
Metadata
Assignees
Labels
idleIssues and pull requests with no activity for three months.Issues and pull requests with no activity for three months.