Skip to content

Commit

Permalink
Update selector to find "Start Over" link
Browse files Browse the repository at this point in the history
  • Loading branch information
madman-bob committed Oct 19, 2017
1 parent 46628f3 commit 985c7db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions POV Cam/injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ function modifyPage() {
});

// Add link to go to the options page
var sogb = getSOGB(outerContainer);
var SOLinkContainer = getStartOverLinkContainer();

if (sogb) {
if (SOLinkContainer) {
var optionsLink = document.createElement("a");
optionsLink.href = chrome.extension.getURL("options/options.html");
optionsLink.innerText = "POV Cam Options";
optionsLink.style["font-weight"] = "bold";
optionsLink.style["font-size"] = "10px";
optionsLink.style.display = "block";

sogb.parentElement.insertBefore(optionsLink, sogb);
SOLinkContainer.parentElement.insertBefore(optionsLink, SOLinkContainer);
}
}

Expand Down
11 changes: 5 additions & 6 deletions POV Cam/mspaintadventures-page-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ function getStandardNextPageLink() {
return linkContainer;
}

function getSOGB(container) {
// sogb = Start Over | Go Back
var sogb = container.querySelector("a[href='?s=6']");
if (sogb) {
sogb = sogb.parentElement.parentElement;
function getStartOverLinkContainer() {
var SOLink = document.querySelector("a[href$='?s=6']");
if (SOLink) {
SOLink = SOLink.parentElement.parentElement;

return sogb;
return SOLink;
}
}

0 comments on commit 985c7db

Please sign in to comment.