Skip to content

Commit e653d40

Browse files
committed
perf: replace responseType default value with text
1 parent 1578a91 commit e653d40

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/ext/background/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ async function handleMessage(message, sender) {
453453
}
454454
xhr.open(method, details.url, true, user, password);
455455
xhr.responseType = details.responseType;
456+
// avoid unexpected behavior of legacy defaults such as parsing XML
457+
if (xhr.responseType === "") xhr.responseType = "text";
456458
// transfer to content script via arraybuffer and then parse to blob
457459
if (xhr.responseType === "blob") xhr.responseType = "arraybuffer";
458460
// transfer to content script via text and then parse to document

0 commit comments

Comments
 (0)