Skip to content

Instantly share code, notes, and snippets.

@mrcnkoba
Created May 31, 2018 13:45
Show Gist options
  • Save mrcnkoba/596b4fa05508ebe81229367f6f6433c6 to your computer and use it in GitHub Desktop.
Save mrcnkoba/596b4fa05508ebe81229367f6f6433c6 to your computer and use it in GitHub Desktop.
popup.createHtmlPanel({
url: YOUR_URL
height: 75
})
.then(function (htmlPanel) {
const onload = (reason) => {
console.log(htmlPanel.window.document.getElementById("register-form"));
};
// if it is still loading please add event listener to DOMContentLoaded
if(htmlPanel.window.readystate === "loading") {
htmlPanel.window.document.addEventListener("DOMContentLoaded", () => onload("domcontentloaded") , true)
}
// It's past the DOMContentLoaded, the DOMContentLoaded won't be fired again. please just call the callback
else{
onload("already done");
}
})
.catch(function (error) {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment