Skip to content

Instantly share code, notes, and snippets.

@cuylerstuwe
Created April 30, 2018 19:52
Show Gist options
  • Select an option

  • Save cuylerstuwe/812d6e07dd49a6c695e490dce48deba4 to your computer and use it in GitHub Desktop.

Select an option

Save cuylerstuwe/812d6e07dd49a6c695e490dce48deba4 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Jump to Queue After Boot Out
// @namespace salembeats
// @version 1
// @description Back to Queue after boot-out.
// @author You
// @include https://worker.mturk.com/
// @include https://worker.mturk.com/projects
// @grant none
// ==/UserScript==
let reactAlertElement = document.querySelector(`div[data-react-class="require('reactComponents/alert/Alert')['PureAlert']"]`);
if(reactAlertElement) {
let reactAlert = JSON.parse(reactAlertElement.dataset.reactProps);
if(reactAlert.header.toLowerCase().includes("hit submitted")) {
window.location.href = "http://worker.mturk.com/tasks";
}
else if(reactAlert.header.toLowerCase().includes("hit submitted")) {
window.location.href = "http://worker.mturk.com/tasks";
}
else if(reactAlert.header.toLowerCase().includes("there are no more of these hits available")) {
window.location.href = "http://worker.mturk.com/tasks";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment