Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Phuks!
- // @namespace https://phuks.co
- // @version 0.1
- // @description Browser add-on for Phuks!
- // @author Phuk you buddy
- // @match https://phuks.co
- // @match https://phuks.co/alt
- // @match https://phuks.co/alt#
- // @match https://phuks.co/alt#/
- // @match https://phuks.co/alt#/*
- // @exclude https://phuks.co/u/*
- // @grant none
- // ==/UserScript==
- // css to make it like a menu item
- var style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML += '#myButton,#OpenExpandos {cursor: pointer;color:#fff;}';
- document.getElementsByTagName('head')[0].appendChild(style);
- // create Expandos link
- var ul = document.querySelector('.pure-menu-list');
- var newli = document.createElement('li');
- newli.innerHTML = '<a class="pure-menu-link" id="OpenExpandos">Expandos</a>';
- newli.setAttribute('class', 'pure-menu-item');
- ul.appendChild(newli);
- // activate link
- document.getElementById ("OpenExpandos").addEventListener (
- "click", ButtonClickAction, false
- );
- // find expandos
- var geta = document.getElementsByClassName("expando"); // expandos
- function ButtonClickAction (zEvent) {
- var clickEvent = document.createEvent ("HTMLEvents");
- clickEvent.initEvent ("click", true, true);
- for(var i = 0; i < geta.length; i++) {
- geta[i].dispatchEvent (clickEvent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement