Last active
May 8, 2018 17:16
-
-
Save alansemenov/1989414339e1cc0715c8 to your computer and use it in GitHub Desktop.
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
function createLauncherPanel() { | |
var div = document.createElement("div"); | |
div.setAttribute("class", "launcher-panel"); | |
div.classList.add("hidden"); | |
div.appendChild(createLauncherLink(div)); | |
document.getElementsByTagName("body")[0].appendChild(div); | |
return div; | |
} | |
function createLauncherLink(container) { | |
var link = document.createElement("link"); | |
link.setAttribute("rel", "import"); | |
link.setAttribute("href", "path_to_my_launcher_page.html"); | |
link.onload = function () { | |
container.appendChild(link.import.querySelector('.launcher-main-container')); | |
}; | |
return link; | |
} | |
createLauncherPanel(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment