如何将chrome greasemonkey脚本限制为单个网页,或仅限于某些网页?

Ste*_*all 23 javascript greasemonkey google-chrome

有没有办法阻止chrome运行greasemonkey脚本,除了在某些域上?我可以做一些hackery location.href,但如果有一个更清洁的解决方案会很好.

当我通过拖动script.user.js器安装到浏览器中时,脚本会自动运行所有网站.

我该如何防止这种情况?

Ste*_*all 33

使用@match,如所描述这里.

例:

// ==UserScript==
// @match http://*/*
// @match http://*.google.com/*
// @match http://www.google.com/*
// ==/UserScript==
Run Code Online (Sandbox Code Playgroud)