Skip to content

Commit

Permalink
Update webRequest.filterResponseData() page (mdn#35860)
Browse files Browse the repository at this point in the history
Use str.replaceAll() instead of str.replace()
  • Loading branch information
def00111 committed Sep 13, 2024
1 parent 7b39306 commit 3994f73
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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 3994f73

Please sign in to comment.