ruffle/web/extension/js/index.js

12 lines
469 B
JavaScript
Raw Normal View History

import { PublicAPI } from "../../js-src/public-api";
import { SourceAPI } from "../../js-src/source-api";
2019-10-06 16:29:15 +00:00
import { get_config_options } from "../../js-src/config";
let html = document.getElementsByTagName("html")[0];
let page_options = get_config_options(html);
if (!page_options.optout) {
window.RufflePlayer = PublicAPI.negotiate(window.RufflePlayer, "extension", new SourceAPI());
} else {
console.log("WebExtension Ruffle execution prohibited by page");
}