您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name compare hktvmall product price to other sites // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author TONYHOKAN // @match https://www.hktvmall.com/*/p/* // @grant none // ==/UserScript== (function() { 'use strict'; var parknshopUrl = 'http://www.parknshop.com/zh-hk/search?text='; var zstoreUrl = 'https://www.ztore.com/tc/search/' var priceComUrl = 'https://www.price.com.hk/search.php?g=A&q=' var googleUrl = 'https://www.google.com.hk/search?q=' var productTitle = encodeURI($('.last').html()) $('.bottomButtons').append(genCheckButton(parknshopUrl+productTitle, 'parknshop')) $('.bottomButtons').append(genCheckButton(zstoreUrl+productTitle, 'zstore')) $('.bottomButtons').append(genCheckButton(priceComUrl+productTitle, 'price.com')) $('.bottomButtons').append(genCheckButton(googleUrl+productTitle + ' -site:https://www.hktvmall.com/', 'google')) function genOnClick(url) { // var searchUrl = 'onclick="window.location.href=\'' + targetUrl + productTitle + '\'"' return 'onclick="window.open(\''+url+'\', \'_blank\')"' } function genCheckButton(url, buttonString) { return '<div class="buttonWrapper"><button class="sepaButton large" ' + genOnClick(url) + '><div class="spriteWrapper"></div><span>' + buttonString + '</span></button></div>' } })(); f