Created
February 18, 2018 13:30
-
-
Save lucaswerkmeister/d53661a7c77f5175af8f0ada639d01e0 to your computer and use it in GitHub Desktop.
Export Special:EditWatchlist’s state before submitting the page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
let list = ''; | |
for ( let checkbox of document.querySelectorAll( 'input[type=checkbox]' ) ) { | |
let checked = checkbox.checked, | |
title = checkbox.value, | |
labelElement = checkbox.nextElementSibling.querySelector( 'a' ), | |
text; | |
if ( !labelElement ) { | |
labelElement = checkbox.nextElementSibling; | |
} | |
text = labelElement.textContent; | |
list += checked + '\t' + title + '\t' + text + '\n'; | |
} | |
let output = document.createElement( 'pre' ); | |
output.textContent = list; | |
document.body.appendChild( output ); | |
console.log( 'done' ); | |
} )(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment