您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Forces domain to use it's new gallery on all listings
// ==UserScript== // @name _Domain force top gallery // @namespace _pc // @run-at document-start // @version 0.1 // @description Forces domain to use it's new gallery on all listings // @match *://*.domain.com.au/* // ==/UserScript== function inArray(needle, haystack) { var length = haystack.length; for(var i = 0; i < length; i++) { if(haystack[i] == needle) return true; } return false; } var oldUrlPath = window.location.pathname; var urlSearch = window.location.search; var validPaths = ["for-rent", "for-sale", "for-share"]; var path = oldUrlPath.match(/\/(.*?)\//) if (path) { var found = inArray(path, validPaths) > -1; } if (!(/(\?topspot=1)+/.test (urlSearch)) && found ) { var newURL = window.location.protocol + "//" + window.location.host + oldUrlPath + "?topspot=1" + window.location.hash ; window.location.replace (newURL); }