您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Inject some javascript into these websites
当前为
// ==UserScript== // @name Construction JavaScript Injection // @description Inject some javascript into these websites // @version 1.0.1 // @author Oliver P // @namespace https://github.com/OlisDevSpot // @license MIT // @match *://*/* // @run-at document-end // @compatible safari // @grant GM.setValue // @grant GM.getValue // @grant GM.registerMenuCommand // ==/UserScript== // jshint esversion: 8 (async function() { // Only run config in top window if (window.self !== window.top) return; let company = await GM.getValue('company'); let firstName = await GM.getValue('firstName'); let lastName = await GM.getValue('lastName'); if (!company || !firstName || !lastName) { // Register a menu option to configure later GM_registerMenuCommand('Set Sales Credentials', configure); // Ask upfront await configure(); } async function configure() { company = prompt('Enter your company name (e.g. david-star):') || ''; firstName = prompt('First name:') || ''; lastName = prompt('Last name:') || ''; if (company && firstName && lastName) { await GM.setValue('company', company); await GM.setValue('firstName', firstName); await GM.setValue('lastName', lastName); location.reload(); } else { alert('Values cannot be empty!'); } } // Build dynamic fetch URL const salesperson = { firstName, lastName }; const currentSiteUrl = encodeURIComponent(window.location.href); const params = new URLSearchParams({ data: JSON.stringify({ currentSiteUrl, salesperson }) }); const url = `https://${company}.pages.dev/your-endpoint?${params}`; // Inject dynamic code fetch(url) .then(res => res.text()) .then(code => { const s = document.createElement('script'); s.textContent = code; document.head.appendChild(s); }) .catch(err => console.error('Inject error:', err)); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址