Skip to content

Instantly share code, notes, and snippets.

@JJJollyjim
Created March 3, 2014 00:31
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 JJJollyjim/9316333 to your computer and use it in GitHub Desktop.
Save JJJollyjim/9316333 to your computer and use it in GitHub Desktop.
chrome.storage.local.get "files", (vals) ->
# alert "Got stuff"
files = vals.files
fileTypes = ["tiles", "splats", "flair", "speedpad", "speedpadred", "speedpadblue", "portal"]
for type in fileTypes
if type of files
document.getElementById(type).src = files[type]
script = document.createElement("script")
script.textContent = """
console.log("Hi from inside!");
(function () {
(function () {
console.log("Hi")
try {
tagpro.api.redrawBackground()
} catch (e) {
console.log("Try again...")
setTimeout(arguments.caller.callee, 100)
}
})()
})()
"""
document.head.appendChild(script)
script.parentNode.removeChild(script)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment