Skip to content

Commit

Permalink
Update webRequest.StreamFilter.write() page (mdn#35861)
Browse files Browse the repository at this point in the history
Use str.replaceAll() instead of str.replace()
  • Loading branch information
def00111 authored Sep 15, 2024
1 parent 2705886 commit 2de85ad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function listener(details) {
let str = decoder.decode(event.data, { stream: true });
// Just change any instance of Example in the HTTP response
// to WebExtension Example.
str = str.replace(/Example/g, "WebExtension Example");
str = str.replaceAll("Example", "WebExtension Example");
filter.write(encoder.encode(str));
filter.disconnect();
};
Expand Down

0 comments on commit 2de85ad

Please sign in to comment.