Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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