mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 17:07:31 +09:00
[Basilisk] Update pdf.js to 1.7.348 from Firefox 54.0.1
This commit is contained in:
parent
328408759a
commit
c5d109556c
14 changed files with 63753 additions and 63745 deletions
|
|
@ -14,17 +14,17 @@
|
|||
*/
|
||||
/* globals Components, Services, XPCOMUtils */
|
||||
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
var EXPORTED_SYMBOLS = ['PdfjsContentUtils'];
|
||||
var EXPORTED_SYMBOLS = ["PdfjsContentUtils"];
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
Cu.import('resource://gre/modules/Services.jsm');
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var PdfjsContentUtils = {
|
||||
_mm: null,
|
||||
|
|
@ -38,21 +38,21 @@ var PdfjsContentUtils = {
|
|||
Services.appinfo.PROCESS_TYPE_CONTENT);
|
||||
},
|
||||
|
||||
init: function () {
|
||||
init() {
|
||||
// child *process* mm, or when loaded into the parent for in-content
|
||||
// support the psuedo child process mm 'child PPMM'.
|
||||
if (!this._mm) {
|
||||
this._mm = Cc['@mozilla.org/childprocessmessagemanager;1'].
|
||||
this._mm = Cc["@mozilla.org/childprocessmessagemanager;1"].
|
||||
getService(Ci.nsISyncMessageSender);
|
||||
this._mm.addMessageListener('PDFJS:Child:refreshSettings', this);
|
||||
Services.obs.addObserver(this, 'quit-application', false);
|
||||
this._mm.addMessageListener("PDFJS:Child:refreshSettings", this);
|
||||
Services.obs.addObserver(this, "quit-application", false);
|
||||
}
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit() {
|
||||
if (this._mm) {
|
||||
this._mm.removeMessageListener('PDFJS:Child:refreshSettings', this);
|
||||
Services.obs.removeObserver(this, 'quit-application');
|
||||
this._mm.removeMessageListener("PDFJS:Child:refreshSettings", this);
|
||||
Services.obs.removeObserver(this, "quit-application");
|
||||
}
|
||||
this._mm = null;
|
||||
},
|
||||
|
|
@ -63,35 +63,35 @@ var PdfjsContentUtils = {
|
|||
* approved pdfjs prefs in chrome utils.
|
||||
*/
|
||||
|
||||
clearUserPref: function (aPrefName) {
|
||||
this._mm.sendSyncMessage('PDFJS:Parent:clearUserPref', {
|
||||
clearUserPref(aPrefName) {
|
||||
this._mm.sendSyncMessage("PDFJS:Parent:clearUserPref", {
|
||||
name: aPrefName
|
||||
});
|
||||
},
|
||||
|
||||
setIntPref: function (aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage('PDFJS:Parent:setIntPref', {
|
||||
setIntPref(aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage("PDFJS:Parent:setIntPref", {
|
||||
name: aPrefName,
|
||||
value: aPrefValue
|
||||
});
|
||||
},
|
||||
|
||||
setBoolPref: function (aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage('PDFJS:Parent:setBoolPref', {
|
||||
setBoolPref(aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage("PDFJS:Parent:setBoolPref", {
|
||||
name: aPrefName,
|
||||
value: aPrefValue
|
||||
});
|
||||
},
|
||||
|
||||
setCharPref: function (aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage('PDFJS:Parent:setCharPref', {
|
||||
setCharPref(aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage("PDFJS:Parent:setCharPref", {
|
||||
name: aPrefName,
|
||||
value: aPrefValue
|
||||
});
|
||||
},
|
||||
|
||||
setStringPref: function (aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage('PDFJS:Parent:setStringPref', {
|
||||
setStringPref(aPrefName, aPrefValue) {
|
||||
this._mm.sendSyncMessage("PDFJS:Parent:setStringPref", {
|
||||
name: aPrefName,
|
||||
value: aPrefValue
|
||||
});
|
||||
|
|
@ -101,24 +101,24 @@ var PdfjsContentUtils = {
|
|||
* Forwards default app query to the parent where we check various
|
||||
* handler app settings only available in the parent process.
|
||||
*/
|
||||
isDefaultHandlerApp: function () {
|
||||
return this._mm.sendSyncMessage('PDFJS:Parent:isDefaultHandlerApp')[0];
|
||||
isDefaultHandlerApp() {
|
||||
return this._mm.sendSyncMessage("PDFJS:Parent:isDefaultHandlerApp")[0];
|
||||
},
|
||||
|
||||
/*
|
||||
* Request the display of a notification warning in the associated window
|
||||
* when the renderer isn't sure a pdf displayed correctly.
|
||||
*/
|
||||
displayWarning: function (aWindow, aMessage, aLabel, accessKey) {
|
||||
displayWarning(aWindow, aMessage, aLabel, aAccessKey) {
|
||||
// the child's dom frame mm associated with the window.
|
||||
let winmm = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell)
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
winmm.sendAsyncMessage('PDFJS:Parent:displayWarning', {
|
||||
winmm.sendAsyncMessage("PDFJS:Parent:displayWarning", {
|
||||
message: aMessage,
|
||||
label: aLabel,
|
||||
accessKey: accessKey
|
||||
accessKey: aAccessKey,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -126,19 +126,19 @@ var PdfjsContentUtils = {
|
|||
* Events
|
||||
*/
|
||||
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic === 'quit-application') {
|
||||
observe(aSubject, aTopic, aData) {
|
||||
if (aTopic === "quit-application") {
|
||||
this.uninit();
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function (aMsg) {
|
||||
receiveMessage(aMsg) {
|
||||
switch (aMsg.name) {
|
||||
case 'PDFJS:Child:refreshSettings':
|
||||
case "PDFJS:Child:refreshSettings":
|
||||
// Only react to this if we are remote.
|
||||
if (Services.appinfo.processType ===
|
||||
Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
let jsm = 'resource://pdf.js/PdfJs.jsm';
|
||||
let jsm = "resource://pdf.js/PdfJs.jsm";
|
||||
let pdfjs = Components.utils.import(jsm, {}).PdfJs;
|
||||
pdfjs.updateRegistration();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue