Skip to content

Instantly share code, notes, and snippets.

@alansemenov
Last active May 8, 2018 17:16
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 alansemenov/1989414339e1cc0715c8 to your computer and use it in GitHub Desktop.
Save alansemenov/1989414339e1cc0715c8 to your computer and use it in GitHub Desktop.
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