Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
importContent(html, clear = true) {
// kill the slot of the active body, all of it
if (clear) {
wipeSlot(this, "*");
}
// pause quickly to ensure wipe goes through successfully
setTimeout(() => {
html = encapScript(html);
let fragment = document.createElement("div");
fragment.insertAdjacentHTML("beforeend", html);
while (fragment.firstChild !== null) {
if (typeof fragment.firstChild.tagName !== typeof undefined) {
// ensure import doesn't import non-sandbox safe things!
if (
window.HaxStore.instance._isSandboxed &&
fragment.firstChild.tagName.toLowerCase() === "iframe"
) {
// Create a replacement tag of the desired type
var replacement = document.createElement("webview");
// Grab all of the original's attributes, and pass them to the replacement
importContent(html, clear = true) {
// kill the slot of the active body, all of it
if (clear) {
wipeSlot(this, "*");
}
// pause quickly to ensure wipe goes through successfully
setTimeout(() => {
html = encapScript(html);
let fragment = document.createElement("div");
fragment.insertAdjacentHTML("beforeend", html);
while (fragment.firstChild !== null) {
if (typeof fragment.firstChild.tagName !== typeof undefined) {
// ensure import doesn't import non-sandbox safe things!
if (
window.HaxStore.instance._isSandboxed &&
fragment.firstChild.tagName.toLowerCase() === "iframe"
) {
// Create a replacement tag of the desired type
var replacement = document.createElement("webview");
// Grab all of the original's attributes, and pass them to the replacement
haxClearBody(confirm = true) {
let status = true;
// only confirm if asked so we can support wipes without it
if (confirm) {
status = prompt("Are you sure you want to delete all content?");
}
// ensure they said yes
if (status) {
wipeSlot(this);
}
}
/**
haxClearBody(confirm = true) {
let status = true;
// only confirm if asked so we can support wipes without it
if (confirm) {
status = prompt("Are you sure you want to delete all content?");
}
// ensure they said yes
if (status) {
wipeSlot(this);
}
}
/**
_gameDirectionsChanged(newValue) {
if (newValue) {
wipeSlot(this);
let div = document.createElement("div");
div.style = "padding: 16px;";
div.innerHTML = newValue;
this.appendChild(div.cloneNode(true));
}
}
static get properties() {
_gameDirectionsChanged(newValue) {
if (newValue) {
wipeSlot(this);
let div = document.createElement("div");
div.style = "padding: 16px;";
div.innerHTML = newValue;
this.appendChild(div.cloneNode(true));
}
}
static get properties() {