|
@@ -42,12 +42,10 @@ function injectedScript() {
|
|
|
window.globalThis = window;
|
|
window.globalThis = window;
|
|
|
}
|
|
}
|
|
|
const document = globalThis.document;
|
|
const document = globalThis.document;
|
|
|
- const console = globalThis.console;
|
|
|
|
|
const dispatchEvent = event => globalThis.dispatchEvent(event);
|
|
const dispatchEvent = event => globalThis.dispatchEvent(event);
|
|
|
const CustomEvent = globalThis.CustomEvent;
|
|
const CustomEvent = globalThis.CustomEvent;
|
|
|
const FileReader = globalThis.FileReader;
|
|
const FileReader = globalThis.FileReader;
|
|
|
const Blob = globalThis.Blob;
|
|
const Blob = globalThis.Blob;
|
|
|
- const warn = (console && console.warn && ((...args) => console.warn(...args))) || (() => { });
|
|
|
|
|
const NEW_FONT_FACE_EVENT = "single-file-new-font-face";
|
|
const NEW_FONT_FACE_EVENT = "single-file-new-font-face";
|
|
|
const DELETE_FONT_EVENT = "single-file-delete-font";
|
|
const DELETE_FONT_EVENT = "single-file-delete-font";
|
|
|
const CLEAR_FONTS_EVENT = "single-file-clear-fonts";
|
|
const CLEAR_FONTS_EVENT = "single-file-clear-fonts";
|
|
@@ -66,7 +64,6 @@ function injectedScript() {
|
|
|
let warningFontFaceDisplayed;
|
|
let warningFontFaceDisplayed;
|
|
|
globalThis.FontFace = function () {
|
|
globalThis.FontFace = function () {
|
|
|
if (!warningFontFaceDisplayed) {
|
|
if (!warningFontFaceDisplayed) {
|
|
|
- warn("SingleFile is hooking the FontFace constructor, document.fonts.delete and document.fonts.clear to handle dynamically loaded fonts.");
|
|
|
|
|
warningFontFaceDisplayed = true;
|
|
warningFontFaceDisplayed = true;
|
|
|
}
|
|
}
|
|
|
getDetailObject(...arguments).then(detail => dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
|
|
getDetailObject(...arguments).then(detail => dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
|