1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-28 23:28:16 +02:00

Detecting if web fonts are disable in Firefox.

This commit is contained in:
Yury Delendik 2012-11-30 16:59:51 -06:00
parent 223ad0c117
commit 5dc87a7fca
4 changed files with 49 additions and 0 deletions

View file

@ -71,6 +71,14 @@ function getBoolPref(pref, def) {
}
}
function getIntPref(pref, def) {
try {
return Services.prefs.getIntPref(pref);
} catch (ex) {
return def;
}
}
function setStringPref(pref, value) {
let str = Cc['@mozilla.org/supports-string;1']
.createInstance(Ci.nsISupportsString);
@ -351,6 +359,10 @@ ChromeActions.prototype = {
getChromeWindow(this.domWindow).gFindBar &&
'updateControlState' in getChromeWindow(this.domWindow).gFindBar;
},
supportsDocumentFonts: function() {
var pref = getIntPref('browser.display.use_document_fonts', 1);
return !!pref;
},
fallback: function(url, sendResponse) {
var self = this;
var domWindow = this.domWindow;