Last active
April 24, 2016 09:23
-
-
Save noromanba/fa888fc754a4c4cb34a420c007b1ad4a to your computer and use it in GitHub Desktop.
proof glitched js/html on plus.shonenjump.com for UserScript
This file contains 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
// ==UserScript== | |
// @name J+ editor-in-chief | |
// @namespace http://noromanba.flavors.me | |
// @description proof glitched js/html on plus.shonenjump.com for UserScript | |
// @include http://plus.shonenjump.com/rensai_detail.html* | |
// @grant none | |
// @noframes | |
// @run-at document-idle | |
// @version 2016.04.24.2 | |
// @homepage https://gist.github.com/noromanba/fa888fc754a4c4cb34a420c007b1ad4a | |
// @downloadURL https://gist.github.com/noromanba/fa888fc754a4c4cb34a420c007b1ad4a/raw/jplus-editor-in-chief.user.js | |
// @license MIT License http://nrm.mit-license.org/2016 | |
// @author noromanba http://noromanba.flavors.me | |
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Pictograms-nps-pets_on_leash-2.svg/64px-Pictograms-nps-pets_on_leash-2.svg.png | |
// ==/UserScript== | |
// Icon (PD by NPS Graphics, ZyMOS) | |
// https://commons.wikimedia.org/wiki/File:Pictograms-nps-pets_on_leash-2.svg | |
// United States National Park Service | |
// https://www.nps.gov/ | |
// Devel | |
// https://gist.github.com/noromanba/fa888fc754a4c4cb34a420c007b1ad4a | |
(() => { | |
'use strict'; | |
const clickale = () => { | |
Array.from(document.body.querySelectorAll('a.btn_list_detail'), container => { | |
// ".standreading_link" is lazy, can't access DOMContentLoaded | |
// i.e. fail in @run-at document-end, use w/ @run-at document-idle or lazyload | |
const link = (container.querySelector('a.standreading_link[href]') || {}).href; | |
if (!link) return; | |
container.href = link; | |
container.target = '_blank'; | |
}); | |
}; | |
clickale(); | |
})(); | |
// DBG | |
// viewer syntax; | |
// http://plus.shonenjump.com/client_info/SHUEISHA/html/player/viewer.html?tw=1&lin=1&cid=<CONTENT_ID> | |
// | |
// e.g. | |
// http://plus.shonenjump.com/rensai_detail.html?item_cd=SHSA_JP01PLUS00002066_57 | |
// | |
// <a class="btn_list_detail cf"> | |
// <img src="/client_info/SHUEISHA/itemimage/SHSA_JP01PLUS00002213_57_cover.jpg" alt="" class="list_detail_image nosave" unselectable="on" width="100%"></img> | |
// <!-- snip --> | |
// <div class="btn_list_detail_read"> | |
// <span class="look_inside invisible"><!-- snip --></span> | |
// <span class="content_id invisible">SHSA_JP01PLUS00002213_57</span> | |
// <a class="standreading_link" href="http://plus.shonenjump.com/client_info/SHUEISHA/html/player/viewer.html?tw=1&;lin=1&;cid=SHSA_JP01PLUS00002213_57" target="_top"> | |
// <img style="display: none ! important;" src="/client_info/SHUEISHA/view/userweb/assets/blank.gif?timestamp=1457085568000"></img> | |
// </a> | |
// </div> | |
// <!-- snip --> | |
// </a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment