您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Search with google image again cause fuck google lens
当前为
- // ==UserScript==
- // @name Search with google image fix
- // @namespace http://tampermonkey.net/
- // @version 1.1.2.1
- // @description Search with google image again cause fuck google lens
- // @author You
- // @require http://code.jquery.com/jquery-3.4.1.min.js
- // @match http://*/*
- // @match https://*/*
- // @exclude https://www.instant-gaming.com/*
- // @grant none
- // ==/UserScript==
- function GM_addStyle(css) {
- const style = document.getElementById("GM_addStyle") || (function() {
- const style = document.createElement('style');
- style.type = 'text/css';
- style.id = "GM_addStyle";
- document.head.appendChild(style);
- return style;
- })();
- const sheet = style.sheet;
- sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
- }
- (function() {
- GM_addStyle(`
- .container__menu {
- /* Absolute position */
- position: absolute;
- /* Reset */
- list-style: none;
- margin: 0;
- padding: 0;
- display: none;
- /* Misc */
- border: 1px solid #cbd5e0;
- border-radius: 0.25rem;
- background-color: #f7fafc;
- }
- `);
- GM_addStyle(`
- .open {
- display: block;
- z-index: 9999;
- }
- `);
- GM_addStyle(`
- .container__item {
- padding: 0.5rem 1rem;
- white-space: nowrap;
- cursor: pointer;
- color: black;
- }
- `);
- GM_addStyle(`
- .container__item:hover {
- background-color: #bee3f8;
- }
- `);
- GM_addStyle(`
- .container__divider {
- border-bottom: 1px solid #cbd5e0;
- height: 1px;
- }
- `);
- $("body").append(`
- <ul id="fucklens" class="container__menu">
- <li class="container__item">Search with google image</li>
- </ul>
- `);
- var cntxtMn = $("#fucklens");
- var mouseX;
- var mouseY;
- var currentTarget = null;
- $(document).mousemove(function(e) {
- mouseX = e.pageX;
- mouseY = e.pageY;
- });
- $("img").on('contextmenu', displayContextMenu);
- const observer = new MutationObserver(function(mutations_list) {
- mutations_list.forEach(function(mutation) {
- mutation.addedNodes.forEach(function(added_node) {
- var img = $(added_node).find("img");
- if (img){
- img.on('contextmenu', displayContextMenu);
- }
- });
- });
- });
- observer.observe(document, { subtree: true, childList: true });
- //thank you for this guy https://jsfiddle.net/JCJDesigns/6zsvmt10/
- function displayContextMenu(e) {
- (cntxtMn.hasClass("open")) ? cntxtMn.removeClass("open") : false;
- if (e.ctrlKey)
- return;
- cntxtMn.css({'top':mouseY,'left':mouseX}).addClass("open");
- e.preventDefault();
- currentTarget = e.target;
- }
- cntxtMn.click(function(e) {
- e.stopPropagation();
- });
- $(document).click(function() {
- (cntxtMn.hasClass("open")) ? cntxtMn.removeClass("open") : false;
- });
- $(".container__item").click(function(){
- var src = "https://www.google.com/searchbyimage?image_url=" + $(currentTarget).prop("src");
- console.log($(currentTarget).prop("src"));
- (cntxtMn.hasClass("open")) ? cntxtMn.removeClass("open") : false;
- window.open(src);
- });
- })();