您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allow installing any webpage as a progressive web app
// ==UserScript== // @name PWAs anywhere mod without options // @match *://*/* // @version 1.0.1 // @author OctoSpacc // @license ISC // @description Allow installing any webpage as a progressive web app // @run-at document-idle // @namespace https://gf.qytechs.cn/users/1381439 // ==/UserScript== var originalManifest = document.querySelector('link[rel="manifest"]'); function makeManifestElem(href) { var manifestElem = document.createElement('link'); manifestElem.rel = 'manifest'; manifestElem.href = href; return manifestElem; } function removeCurrentManifest() { var manifestElem = document.querySelector('link[rel="manifest"]'); if (manifestElem) { manifestElem.parentElement.removeChild(manifestElem); } } function createAndInjectManifest() { var iconElem = (document.querySelector('link[rel~="apple-touch-icon"]') || document.querySelector('link[rel~="icon"]')); var manifestElem = makeManifestElem('data:application/manifest+json;utf8,' + encodeURIComponent(JSON.stringify({ name: (document.title || location.href), start_url: location.href, scope: (location.protocol + '//' + location.hostname + '/'), display: "standalone", background_color: (getComputedStyle(document.body).backgroundColor || '#000000'), theme_color: '#000000', icons: [{ src: ((iconElem && iconElem.href) || (location.href + '/favicon.ico')), sizes: "any", purpose: "any", }, ], }))); document.head.appendChild(manifestElem); } if (originalManifest) { removeCurrentManifest(); createAndInjectManifest(); } else { createAndInjectManifest(); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址