User:It's moon/common.js

From Just Solve the File Format Problem
< User:It's moon(Difference between revisions)
Jump to: navigation, search
(Is this even loading?)
 
Line 1: Line 1:
// Confirm common.js is loading
+
const numWords = $( '#mw-content-text > div' ).text().split( ' ' ).length;
console.log("common.js loaded");
+
const headerWords = $( 'h1' ).text().split( ' ' ).length;
 
+
const totalWords = numWords + headerWords;
// Automatically submit CAPTCHA after 5 seconds
+
const timeInMinutes = totalWords / 200;
$(function () {
+
const header = $( 'h1' ).text();
  setTimeout(function () {
+
$( 'h1' ).text( header + ' (it will take you ' + timeInMinutes + ' minutes to read this page)' );
    if ($("#wpCaptchaWord").length) {
+
      console.log("CAPTCHA detected — submitting");
+
      $("#wpCaptchaWord").val("herpderp").trigger("input");
+
      $("#wpSave").click();
+
    } else {
+
      console.log("CAPTCHA not found");
+
    }
+
  }, 5000);
+
});
+

Latest revision as of 05:02, 23 May 2025

const numWords = $( '#mw-content-text > div' ).text().split( ' ' ).length;
const headerWords = $( 'h1' ).text().split( ' ' ).length;
const totalWords = numWords + headerWords;
const timeInMinutes = totalWords / 200;
const header = $( 'h1' ).text();
$( 'h1' ).text( header + ' (it will take you ' + timeInMinutes + ' minutes to read this page)' );
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox