Coolapk open in app

Fix Open Coolapk APP from Web

目前为 2021-04-13 提交的版本。查看 最新版本

// ==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);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址