Skip to content

Instantly share code, notes, and snippets.

@curioussavage
Last active January 26, 2022 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curioussavage/9b0c251d939c5db4d6a5d9e30f34d2ea to your computer and use it in GitHub Desktop.
Save curioussavage/9b0c251d939c5db4d6a5d9e30f34d2ea to your computer and use it in GitHub Desktop.
hyperscript context script
def incidentApp.init()
log "hello world"
end
chrome.extension.sendMessage({}, function(response) {
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
clearInterval(readyStateCheckInterval);
var app = document.createElement('script');
var scriptPath = chrome.runtime.getURL("src/inject/app._hs");
app.setAttribute("src", scriptPath);
app.setAttribute("type","text/hyperscript");
document.head.appendChild(app);
var hyperscript = document.createElement('script');
hyperscript.setAttribute("src","https://unpkg.com/hyperscript.org@0.9.4");
hyperscript.addEventListener('load', function() {
incidentApp.init()
});
document.head.appendChild(hyperscript);
}
}, 10);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment