Greasy Fork

Greasy Fork is available in English.

新标签打开

github 新标签页打开

目前为 2017-12-12 提交的版本。查看 最新版本

// ==UserScript==
// @name         新标签打开
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  github 新标签页打开
// @author       [email protected]
// @match        http*://*.github.com/*
// @match        http*://packagist.org/*
// @require      https://code.jquery.com/jquery-latest.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    $(function(){
		switch(window.location.host) {
			case "packagist.org":
				setInterval(function(){
					$(".package-item h4>a").attr("target", "_blank");
				}, 1000);
				break;
			default:
				$(".repo-list h3>a").attr("target", "_blank");
				break;
		}
		
    });
})();