1
0
Fork 0
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:
Julian Viereck 2011-06-23 13:25:59 +02:00
parent a3d815074d
commit da7f555fd7
4 changed files with 70 additions and 101 deletions

View file

@ -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);