huhuhu
火狐狸
火狐狸
  • UID34430
  • 注册日期2010-11-04
  • 最后登录2013-11-28
  • 发帖数119
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 社区居民
阅读:3450回复:9

请问UC脚本可以设定为指定网站才启动吗?

楼主#
更多 发布于:2011-04-20 16:21
如题,前两天用了GOLF-AT老兄的一个UC脚本Open_link_in_tab,好像全局监听鼠标点击函数,当网页符合条件就执行新标签页打开。这样的脚本能不能只在特定的网页才执行监听呢?是不是类似的脚本太多会加重FF的负担?有人能给我讲讲吗?
dawlen
狐狸大王
狐狸大王
  • UID34286
  • 注册日期2010-10-20
  • 最后登录2015-05-28
  • 发帖数311
  • 经验15枚
  • 威望0点
  • 贡献值8点
  • 好评度0点
  • 社区居民
1楼#
发布于:2011-04-20 16:21
如果是使用UC扩展的话,可以使用:
@include / @exclude
huhuhu
火狐狸
火狐狸
  • UID34430
  • 注册日期2010-11-04
  • 最后登录2013-11-28
  • 发帖数119
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 社区居民
2楼#
发布于:2011-04-20 16:21
谢谢楼上的老兄,请问我怎么看这些脚本有没有被调用呢?还有这些脚本用什么可以debug呢?
kmc
kmc
管理员
管理员
  • UID165
  • 注册日期2004-11-25
  • 最后登录2022-09-22
  • 发帖数9186
  • 经验397枚
  • 威望1点
  • 贡献值124点
  • 好评度41点
  • 忠实会员
  • 终身成就
  • 社区居民
3楼#
发布于:2011-04-20 16:21
huhuhu:谢谢楼上的老兄,请问我怎么看这些脚本有没有被调用呢?还有这些脚本用什么可以debug呢?回到原帖

启动firefox时在Error console里能看到哪些脚本被载入了。
Waterfox Current和Firefox Nightly都用,逐渐走出XUL扩展依赖
huhuhu
火狐狸
火狐狸
  • UID34430
  • 注册日期2010-11-04
  • 最后登录2013-11-28
  • 发帖数119
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 社区居民
4楼#
发布于:2011-04-20 16:21
谢谢啊,那debug呢?
GOLF-AT
千年狐狸
千年狐狸
  • UID11611
  • 注册日期2006-02-20
  • 最后登录2019-12-30
  • 发帖数3239
  • 经验265枚
  • 威望1点
  • 贡献值260点
  • 好评度59点
  • 社区居民
  • 忠实会员
5楼#
发布于:2011-04-20 16:21
dawlen:如果是使用UC扩展的话,可以使用:
@include / @exclude
回到原帖

这个是GM脚本才可以这样做的吧,uc 脚本不可以。还是说最新的 userScript.JS 扩展支持这样了?
dawlen
狐狸大王
狐狸大王
  • UID34286
  • 注册日期2010-10-20
  • 最后登录2015-05-28
  • 发帖数311
  • 经验15枚
  • 威望0点
  • 贡献值8点
  • 好评度0点
  • 社区居民
6楼#
发布于:2011-04-20 16:21
GOLF-AT
这个是GM脚本才可以这样做的吧,uc 脚本不可以。还是说最新的 userScript.JS 扩展支持这样了?
回到原帖

我用的是UC扩展,说是可以,我也没试过。
链接:https://addons.mozilla.org/zh-CN/firefox/addon/uc/

uc is a Firefox extension that allows you to run arbitrary local scripts in chrome windows. In short, userChromeJS + subscriptoverlayloader.js.
usage

Choose script paths and depths in options (Tools -> uc) to autoload according to their meta data block.

    If directory, all *.uc.{js,xul,css} files below it up to specified depth are loaded.
    If depth is 0, the path is ignored.
    The default setting has a single <UChrm> meaning that it loads the chrome directory in your current profile as does subscriptoverlayloader. Note that userChrome.js isn't loaded.

supported metadata

The syntax is roughly identical to Greasemonkey's.

    @name The script name.

    @include / @exclude The URL onto which this script is/isn't loaded.
        * are wildcards.
        If prefixed with ~, the rest is treated as regular expression pattern. (example)

    @require Accepts a script URL and loads it beforehand.
        The URL can be absolute or relative, but must be local.
        Will not load the same script twice for a window.

    @delay The delay before overlay in milliseconds. XUL only.

    @(whatever) All other meta data are stored simply as text data. UC object defined in each window keeps them.

improvements from userChromeJS + subscriptoverlayloader.js

    Lets you specify files/directories to load.
    Targets subwindows as well, such as about:config or the sidebar UIs.
    Reads meta data only when necessary--on startup or on script update.
    Regex in @include/@exclude.
    @require

drawbacks

    Runs on Firefox 3.5+ only.
    Scamps workaround for http://bugzil.la/330458.
GOLF-AT
千年狐狸
千年狐狸
  • UID11611
  • 注册日期2006-02-20
  • 最后登录2019-12-30
  • 发帖数3239
  • 经验265枚
  • 威望1点
  • 贡献值260点
  • 好评度59点
  • 社区居民
  • 忠实会员
7楼#
发布于:2011-04-20 16:21
uc,新出的一个扩展,在 userChromeJS 基础上修改的。我想大多数人用的是 userChromeJS 扩展,不能使用 @include / @exclude。
dawlen
狐狸大王
狐狸大王
  • UID34286
  • 注册日期2010-10-20
  • 最后登录2015-05-28
  • 发帖数311
  • 经验15枚
  • 威望0点
  • 贡献值8点
  • 好评度0点
  • 社区居民
8楼#
发布于:2011-04-20 16:21
GOLF-AT:uc,新出的一个扩展,在 userChromeJS 基础上修改的。我想大多数人用的是 userChromeJS 扩展,不能使用 @include / @exclude。回到原帖

userChromeJS 扩展,作者貌似停更了吧?而且也非官方认证的扩展,不在AMO里。
GOLF-AT
千年狐狸
千年狐狸
  • UID11611
  • 注册日期2006-02-20
  • 最后登录2019-12-30
  • 发帖数3239
  • 经验265枚
  • 威望1点
  • 贡献值260点
  • 好评度59点
  • 社区居民
  • 忠实会员
9楼#
发布于:2011-04-20 16:21
dawlen
userChromeJS 扩展,作者貌似停更了吧?而且也非官方认证的扩展,不在AMO里。
回到原帖

作者没有停止更新,今年2月还更新了的,最新是 Ver 1.3。在不在 AMO 里,我觉得倒不是很重要。
游客

返回顶部