Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Github_Pages_Linker/Github_Pages_Linker.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pages_Linker/Github_Pages_Linker.user.js
// @supportURL https://github.com/jerone/UserScripts/issues
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW
// @version 1.1
// @version 1.2
// @grant none
// @run-at document-end
// @include https://github.com/*
Expand All @@ -29,6 +29,10 @@
};

function addLink() {
if(document.getElementById("GithubPagesLinker")) {
return;
}

var meta = document.querySelector(".repository-meta");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an new line after this section.

if (!meta) {
return;
Expand All @@ -43,7 +47,7 @@
var url = String.format("https://{0}.github.io/{1}", tree[1], tree[2]);

var div = document.createElement("div");
div.classList.add('GithubPagesLinker');
div.id = "GithubPagesLinker";
div.style.margin = "-10px 0px 10px";
meta.parentNode.insertBefore(div, meta.nextSibling);

Expand Down