Skip to content

Commit

Permalink
fix: FormData火狐无法clone导致错误
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 24, 2021
1 parent 0d75d86 commit e5190e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/apps/grant/background.ts
Expand Up @@ -12,7 +12,6 @@ import { Permission } from "@App/model/do/permission";
import { Script } from "@App/model/do/script";
import { Value } from "@App/model/do/value";
import { execMethod, getIcon } from "./utils";
import { Tab } from "@App/views/components/Tab";

class postMessage implements IPostMessage {

Expand Down Expand Up @@ -531,9 +530,10 @@ export class BackgroundGrant {
data.append(val.key, val.val);
}
}
config.data = data;
xhr.send(data);
} else {
xhr.send(config.data);
}
xhr.send(config.data);
return resolve(undefined);
});
}
Expand Down
10 changes: 7 additions & 3 deletions src/apps/msg-center/browser.ts
Expand Up @@ -28,12 +28,16 @@ export class BrowserMsg {
}

public send(topic: string, msg: any) {
let detail = {
let detail = Object.assign({}, {
topic: topic,
msg: msg,
};
});
if ((<any>global).cloneInto) {
detail = (<any>global).cloneInto(detail, document.defaultView);
try {
detail = (<any>global).cloneInto(detail, document.defaultView);
} catch (e) {
console.log(e);
}
}
let ev = new CustomEvent(this.id + (this.content ? 'fd' : 'ct'), {
detail: detail,
Expand Down

0 comments on commit e5190e3

Please sign in to comment.