Last active
April 6, 2017 16:28
-
-
Save noromanba/a479fa5bc3c4619383ee62f6af74c923 to your computer and use it in GitHub Desktop.
[DONE] fix "NotoSerif Subset OTF" wrong links; 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 isNotoSerif! | |
// @namespace http://noromanba.flavors.me | |
// @description [DONE] fix "NotoSerif Subset OTF" wrong links; for UserScript | |
// @include https://www.google.com/get/noto/help/cjk/ | |
// @grant none | |
// @noframes | |
// @run-at document-end | |
// @version 2017.4.6.0 | |
// @homepage https://gist.github.com/noromanba/a479fa5bc3c4619383ee62f6af74c923 | |
// @downloadURL https://gist.github.com/noromanba/a479fa5bc3c4619383ee62f6af74c923/raw/isnotoserif.user.js | |
// @license MIT License https://nrm.mit-license.org/2017 | |
// @author noromanba http://noromanba.flavors.me | |
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/PPFeather01.svg/512px-PPFeather01.svg.png | |
// ==/UserScript== | |
// Icon (PD by hannPoufPouf) | |
// https://commons.wikimedia.org/wiki/File%3APPFeather01.svg | |
// Devel | |
// https://gist.github.com/noromanba/a479fa5bc3c4619383ee62f6af74c923 | |
// Bookmarklet | |
// http://let.hatelabo.jp/noromanba/let/hLHW56bVtuAQ | |
// already has been fixed c.f. | |
// http://ptech.g.hatena.ne.jp/noromanba/20170404/1491337619 | |
// "Region-specific Subset OpenType/CFF (Subset OTF)" section c.f. | |
// https://www.google.com/get/noto/help/cjk/ | |
(() => { | |
'use strict'; | |
/* | |
// XXX use XPath, smart | |
// TODO assertion | |
const subsetOTF = [...document.body.querySelectorAll('.cjk-downloads')].pop(); | |
const subsetOTFSerif = [...subsetOTF.querySelectorAll('tbody tr')].pop(); | |
Array.from(subsetOTFSerif.querySelectorAll([ | |
'a[href*="/NotoSans"]' | |
]), serif => serif.href = serif.href.replace(/\/NotoSans/, '/NotoSerif')); | |
*/ | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment