Last active
January 26, 2022 22:26
-
-
Save curioussavage/9b0c251d939c5db4d6a5d9e30f34d2ea to your computer and use it in GitHub Desktop.
hyperscript context script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def incidentApp.init() | |
log "hello world" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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