Last active
October 22, 2019 14:53
-
-
Save musaprg/0a4b58458b8cf3e7ef64770d49cfa8fd to your computer and use it in GitHub Desktop.
大学の契約DBのURLに自動で遷移してくれるUserscript
This file contains hidden or 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 Jump to Waseda Univ. Domain automatically | |
| // @namespace musaprg | |
| // @version 0.1.1 | |
| // @description try to take over the world! | |
| // @author Kotaro Inoue <k.musaino@gmail.com> | |
| // @match https://dl.acm.org/* | |
| // @match https://ieeexplore.ieee.org/* | |
| // @match https://link.springer.com/* | |
| // @updateURL https://gist.githubusercontent.com/musaprg/0a4b58458b8cf3e7ef64770d49cfa8fd/raw/user.js | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| let domains = { | |
| "dl.acm.org":"https://dl-acm-org.ez.wul.waseda.ac.jp", | |
| "link.springer.com":"https://link-springer-com.ez.wul.waseda.ac.jp", | |
| "ieeexplore.ieee.org":"https://ieeexplore-ieee-org.ez.wul.waseda.ac.jp", | |
| }; | |
| let key = document.URL.match(/https:\/\/(.*\.[a-zA-Z]+)\/(.*)/); | |
| let url = domains[key[1]] + "/" + key[2]; | |
| location.href = url; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment