获取当前页面的前端应用资源id

用于测试脚本引用

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/456095/1125321/%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%89%8D%E7%AB%AF%E5%BA%94%E7%94%A8%E8%B5%84%E6%BA%90id.js

// ==UserScript==
// @name         获取当前页面的前端应用资源id
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  用于测试脚本引用
// @author       You
// @match        https://*.kujiale.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=umx.art
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    // test.testJS();
    let elements = document.getElementsByTagName("script");
    for (let index = 0; index < elements.length; index++) {
    const element = elements[index];
    let a = element.getAttribute("type");
    if(a !== null){
        if (a === "pub-meta"){
            console.log("应用: " + element.getAttribute("pn"));
            console.log("版本: " + element.getAttribute("pv") + " 资源id: "+ element.getAttribute("ps"));
        }
    }
}

})();