Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active April 6, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noromanba/a479fa5bc3c4619383ee62f6af74c923 to your computer and use it in GitHub Desktop.
Save noromanba/a479fa5bc3c4619383ee62f6af74c923 to your computer and use it in GitHub Desktop.
[DONE] fix "NotoSerif Subset OTF" wrong links; for UserScript
// ==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