暴力猴 双击页面弹出导航栏 本页打开 - chrome 插件脚本

// ==UserScript==
// @name        双击页面嵌入leftRight
// @namespace   Violentmonkey Scripts
// @match       https://*/*
// @exclude     https://reciter.codeberg.page/docs/*
// @grant       none
// @version     1.0
// @author      -
// @description 2025/1/26 13:43:40
// ==/UserScript==



(function() {
    'use strict';
  var list = `
  <a href="https://kimi.moonshot.cn/">KIMI</a>
  <a href="https://www.baidu.com">baidu.com</a>
  <a href="chrome-extension://jinjaccalgkegednnccohejagnlnfdag/options/index.html#scripts/4" target="_blank">编辑(Ctrl+L)</a>
`;

  var style = document.createElement('style');
document.head.appendChild(style);

style.sheet.insertRule(`
  #idPopup {
    text-align: left;
    z-index: 99999;
    padding: 10px;
    display: none;
    background-color: #3c3c3c;
    border: 1px solid #cdcdcd;
    position: fixed;
    width: 80%;
    height: 50%;
    left: 10%;
    top: 15%;
  }
`, style.sheet.cssRules.length);

style.sheet.insertRule(`
  #idPopup a {
    font-size: 16px;
    color: #cdcdcd;
    padding: 10px;
  }
`, style.sheet.cssRules.length);

style.sheet.insertRule(`
  #idPopup a:hover {
    color: #57a3f3;
  }
`, style.sheet.cssRules.length);

var idPopup = document.createElement('div');
idPopup.id = 'idPopup';
idPopup.innerHTML = list;

document.body.appendChild(idPopup);

document.body.addEventListener('dblclick', function() {
  var display = idPopup.style.display;
  idPopup.style.display = display === 'block' ? 'none' : 'block';
});


//    document.body.addEventListener('dblclick', function() {

//      document.location.href = "http://127.0.0.1:12301/"

//   });




})();
posted @ 2025-01-27 09:55  彭成刚  阅读(73)  评论(0)    收藏  举报