Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 4chanx set 'Prefetch Images'
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description it tries to do the thing (you must enable 'Image prefetching')
- // @author justrunmyscripts
- // @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
- // @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
- // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
- // @match http://boards.4chan.org/*/thread/*
- // @grant none
- // ==/UserScript==
- /* jshint ignore:start */
- var inline_src = (<><![CDATA[
- /* jshint ignore:end */
- /* jshint esnext: false */
- /* jshint esversion: 6 */
- $.noConflict();
- document.addEventListener('4chanXInitFinished', (e)=> {
- window.setTimeout( ()=>{
- console.log("hello there!, some JS has been run on this page! (checking your 'prefetch images' checkbox!, check it out yourself!)");
- jQuery('#shortcut-menu > .menu-button').click();
- jQuery('input[type=checkbox][name=prefetch]').click();
- jQuery('#shortcut-menu > .menu-button').click();
- }, 1000);
- }, false);
- /* jshint ignore:start */
- ]]></>).toString();
- var c = Babel.transform(inline_src, { presets: [ "es2015", "es2016" ] });
- eval(c.code);
- /* jshint ignore:end */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement