Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cuylerstuwe/5bb43c2a3d5c2b8cff985b5bf3a66af6 to your computer and use it in GitHub Desktop.
Save cuylerstuwe/5bb43c2a3d5c2b8cff985b5bf3a66af6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Public -Testing Headers
// @namespace salembeats forked by jrw254 (sabedth)
// @version 1.1
// @description Links to whatever you want on the Overview & Earnings Bar Original code by salembeats with a small tweak to place inside this specific navbar
// Combine this with Forking Panda Links on mTurk Dashboard for double the links!
// @author Cuyler Stuwe (salembeats) forked by jrw254 (sabedth)
// @include https://worker.mturk.com/dashboard*
// @include https://worker.mturk.com/tasks*
// @include https://worker.mturk.com/projects*
// @include https://worker.mturk.com/earnings*
// ==/UserScript==
const header = document.querySelector("ul.navbar-sub-nav.navbar-nav.p-a-0");
[
["|", "*"], // This is just a spacer to seperate sections. You do not have to touch it but can remove it if liked and also a templete to add other spacers.
// This is standard but can change. remember this works from bottom to top. AM Payments will start but everything below this will generate to the left of the bar
["AM Payments", "https://payments.amazon.com/aes/withdrawals"],
["Hit Que Link", "https://worker.mturk.com/tasks"],
["Hit Tracker", "chrome-extension://iglbakfobmoijpbigmlfklckogbefnlf/hit_tracker/hit_tracker.html"],
// Spacer Below
["|", "*"],
// Second section. Can be anything you want.
["Name Here", "any link here"],
["Name Here", "any link here"],
["Name Here", "any link here"],
["Name Here", "any link here"],
// Spacer Below
["|", "*"],
// Third section can be anything you want
["Name Here", "any link here"]
].forEach(captionLinkTuple => {
captionLinkTuple[1].includes("://") ? (
header.insertAdjacentHTML("afterbegin", `<li class="nav-item"><a class="nav-link" target="_blank" href="${captionLinkTuple[1]}">${captionLinkTuple[0]}</a></li>`)
) : (
header.insertAdjacentHTML("afterbegin", `<li class="nav-item"><span class="nav-link">${captionLinkTuple[0]}</span></li>`)
)
});
@cuylerstuwe
Copy link
Author

Forked/changed so that plaintext fields aren't inserted as anchor elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment