Skip to content

Commit e5190e3

Browse files
committed
fix: FormData火狐无法clone导致错误
1 parent 0d75d86 commit e5190e3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/apps/grant/background.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Permission } from "@App/model/do/permission";
1212
import { Script } from "@App/model/do/script";
1313
import { Value } from "@App/model/do/value";
1414
import { execMethod, getIcon } from "./utils";
15-
import { Tab } from "@App/views/components/Tab";
1615

1716
class postMessage implements IPostMessage {
1817

@@ -531,9 +530,10 @@ export class BackgroundGrant {
531530
data.append(val.key, val.val);
532531
}
533532
}
534-
config.data = data;
533+
xhr.send(data);
534+
} else {
535+
xhr.send(config.data);
535536
}
536-
xhr.send(config.data);
537537
return resolve(undefined);
538538
});
539539
}

src/apps/msg-center/browser.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ export class BrowserMsg {
2828
}
2929

3030
public send(topic: string, msg: any) {
31-
let detail = {
31+
let detail = Object.assign({}, {
3232
topic: topic,
3333
msg: msg,
34-
};
34+
});
3535
if ((<any>global).cloneInto) {
36-
detail = (<any>global).cloneInto(detail, document.defaultView);
36+
try {
37+
detail = (<any>global).cloneInto(detail, document.defaultView);
38+
} catch (e) {
39+
console.log(e);
40+
}
3741
}
3842
let ev = new CustomEvent(this.id + (this.content ? 'fd' : 'ct'), {
3943
detail: detail,

0 commit comments

Comments
 (0)