ruffle/web/packages/extension/js/index.js

25 lines
736 B
JavaScript
Raw Normal View History

import { PublicAPI, SourceAPI, publicPath } from "ruffle-core";
window.RufflePlayer = PublicAPI.negotiate(
window.RufflePlayer,
"extension",
new SourceAPI("extension")
);
__webpack_public_path__ = publicPath(window.RufflePlayer.config, "extension");
if (obfuscatedEventPrefix) {
2020-12-14 10:29:20 +00:00
document.addEventListener(obfuscatedEventPrefix + "_request", function (e) {
let body = JSON.parse(e.detail);
let response = {};
2020-12-14 10:29:20 +00:00
if (body.action === "get_page_options") {
2021-01-03 13:38:11 +00:00
//response.pageOptions = pageOptions;
}
2020-12-14 10:29:20 +00:00
let event = new CustomEvent(obfuscatedEventPrefix + "_response", {
detail: JSON.stringify(response),
});
document.dispatchEvent(event);
});
}