Greasy Fork is available in English.
Fix Open Coolapk APP from Web
当前为
// ==UserScript==
// @name Coolapk open in app
// @name:zh-CN 在酷安APP中打开
// @namespace coolapk
// @version 0.0.1
// @description Fix Open Coolapk APP from Web
// @description:zh-CN 修复从Coolapk网页调起APP客户端
// @author wherewhere
// @match https://www.coolapk.com/*
// @match http://www.coolapk.com/*
// @match https://*.coolapk.com/*
// @icon https://static.coolapk.com/static/web/v8/img/under_logo.png
// @grant unsafeWindow
// ==/UserScript==
function toApp () {
var url = window.location.href;
var URI="";
URI= "coolapk://" + url;
window.open(URI)
}
addJS_Node (toApp);
function addJS_Node (text, s_URL, funcToRun, runOnLoad) {
var D = document;
var scriptNode = D.createElement ('script');
if (runOnLoad) {
scriptNode.addEventListener ("load", runOnLoad, false);
}
scriptNode.type ="text/javascript";
if (text) scriptNode.textContent = text;
if (s_URL) scriptNode.src = s_URL;
if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
targ.appendChild (scriptNode);
}