mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Change postMessage to send only one object that holds the action and data.
This commit is contained in:
parent
a3d815074d
commit
da7f555fd7
4 changed files with 70 additions and 101 deletions
10
fonts.js
10
fonts.js
|
@ -768,12 +768,14 @@ var Font = (function () {
|
|||
// Insert the font-face css on the page. In a web worker, this needs to
|
||||
// be forwareded on the main thread.
|
||||
if (typeof window == "undefined") {
|
||||
postMessage("font");
|
||||
postMessage(JSON.stringify({
|
||||
str: str,
|
||||
postMessage({
|
||||
action: "font",
|
||||
data: {
|
||||
raw: str,
|
||||
fontName: fontName,
|
||||
mimetype: this.mimetype
|
||||
}));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var base64 = window.btoa(str);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue