您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2020/7/25 下午3:59:45
- // ==UserScript==
- // @name developer.android.com 访问
- // @namespace https://github.com/XanderWang
- // @match *://*/*
- // @grant none
- // @version 1.0
- // @icon https://i.loli.net/2020/05/29/DxSmHAy2o53FdUY.png
- // @author XanderWang
- // @description 2020/7/25 下午3:59:45
- // ==/UserScript==
- (function() {
- 'use strict';
- // Your code here...
- function jumpUrl() {
- /// 获取所有 a 标签
- var documents = document.getElementsByTagName("a");
- for (var i = 0; i < documents.length; i++) {
- var _href = decodeURIComponent(documents[i].href)
- if(_href.indexOf("developer.android.com") != -1) {
- documents[i].href = _href.replace(".android.com",".android.google.cn")
- // console.log('ori', _href, 'real', documents[i].href)
- }
- }
- }
- jumpUrl();
- window.onscroll = function() {
- setTimeout(function() {
- jumpUrl()
- }, 500)
- }
- })();