I would say, in general, if your purpose is to modify the way a webpage is displayed/functions, then Greasemonkey is the way to go. If you have a bunch of window/UI to display and you are really going beyond the core intention of Greasemonkey then it's probably best to stick with a more traditional extension.
One think greasemonkey scripts can't invoke UniversalXPConnect. I run into some problems due to this, not sure whether this can be solved with a Firefox extension. But I feel pretty much constrained as not able to call the UniversalXPConnect and do something big.
Now Google Chrome is gaining popularity. And it also has its own Extension API. Most simple Greasemonkey scripts would install on Google Chrome as it is without any tweaks. If you are using XHR then you might have to create a Chrome Extension.
I believe now Mozilla has realized that the Firefox Extension needs an overhaul. At the moment they are pushing for Jetpack. They should have improved Extension mechanism long time ago taking cue from the success of Greasemonkey.
I'm just adding to your question that there are more options then just Greasemonkey and Firefox Extension. You want a solution that would be easy to install/run on multiple browsers.
I would think out what 'features' I'm going to implement in browser extension and then see which extension mechanism (GM, Jetpack, FF extension, Google Chrome Extension) supports all the features.
Since asking this, I've started working with compiling Greasemonkey scripts in Firefox. Works like a charm.
The limitations are all things that you cannot do with a Greasemonkey extension. You cannot do a real Firefox Add-on Preferences box, nor much serious "Chrome" stuff. The only thing you can modify in the browser is the chrome.css that comes up sometime before page load.
There are probably other limits (see Priyank's answer, which has to do with accessing the local filesystem).
As philfreo says, if your intention is to modify a webpage, Greasemonkey is a fine way to go. I have seen NO problems in compiling Greasemonkey extensions (amazingly) and getting them to work as they do in Greasemonkey.
发布评论
评论(4)
我想说,一般来说,如果您的目的是修改网页的显示/功能方式,那么 Greasemonkey 就是您的最佳选择。如果您有一堆窗口/UI 要显示,并且您确实超出了 Greasemonkey 的核心意图,那么最好坚持使用更传统的扩展。
I would say, in general, if your purpose is to modify the way a webpage is displayed/functions, then Greasemonkey is the way to go. If you have a bunch of window/UI to display and you are really going beyond the core intention of Greasemonkey then it's probably best to stick with a more traditional extension.
有人认为greasemonkey 脚本无法调用UniversalXPConnect。因此我遇到了一些问题,不确定是否可以通过 Firefox 扩展来解决。但我感到非常受限,因为无法调用 UniversalXPConnect 并做一些大事。
One think greasemonkey scripts can't invoke UniversalXPConnect. I run into some problems due to this, not sure whether this can be solved with a Firefox extension. But I feel pretty much constrained as not able to call the UniversalXPConnect and do something big.
现在,谷歌浏览器越来越受欢迎。并且它还有自己的扩展API。大多数简单的 Greasemonkey 脚本都会安装在 Google Chrome 上,无需任何调整。如果您使用 XHR,那么您可能需要创建一个 Chrome 扩展。
我相信现在 Mozilla 已经意识到 Firefox 扩展需要彻底改革。目前他们正在推动 Jetpack。他们应该从 Greasemonkey 的成功中得到启发,很久以前就应该改进扩展机制。
我只是补充一下你的问题,除了 Greasemonkey 和 Firefox Extension 之外,还有更多的选择。您需要一个易于在多个浏览器上安装/运行的解决方案。
我会想出我要在浏览器扩展中实现哪些“功能”,然后查看哪种扩展机制(GM、Jetpack、FF 扩展、Google Chrome 扩展)支持所有功能。
Now Google Chrome is gaining popularity. And it also has its own Extension API. Most simple Greasemonkey scripts would install on Google Chrome as it is without any tweaks. If you are using XHR then you might have to create a Chrome Extension.
I believe now Mozilla has realized that the Firefox Extension needs an overhaul. At the moment they are pushing for Jetpack. They should have improved Extension mechanism long time ago taking cue from the success of Greasemonkey.
I'm just adding to your question that there are more options then just Greasemonkey and Firefox Extension. You want a solution that would be easy to install/run on multiple browsers.
I would think out what 'features' I'm going to implement in browser extension and then see which extension mechanism (GM, Jetpack, FF extension, Google Chrome Extension) supports all the features.
自从提出这个问题后,我就开始在 Firefox 中编译 Greasemonkey 脚本。就像魅力一样。
这些限制是 Greasemonkey 扩展无法做到的所有事情。你不能做一个真正的 Firefox 附加偏好设置框,也不能做太多严肃的“Chrome”东西。您在浏览器中唯一可以修改的是在页面加载之前出现的 chrome.css。
可能还有其他限制(请参阅 Priyank 的答案,这与访问本地文件系统有关)。
正如 philfreo 所说,如果您打算修改网页,Greasemonkey 是一个不错的选择。我在编译 Greasemonkey 扩展并让它们像在 Greasemonkey 中一样工作时没有发现任何问题(令人惊讶)。
Since asking this, I've started working with compiling Greasemonkey scripts in Firefox. Works like a charm.
The limitations are all things that you cannot do with a Greasemonkey extension. You cannot do a real Firefox Add-on Preferences box, nor much serious "Chrome" stuff. The only thing you can modify in the browser is the chrome.css that comes up sometime before page load.
There are probably other limits (see Priyank's answer, which has to do with accessing the local filesystem).
As philfreo says, if your intention is to modify a webpage, Greasemonkey is a fine way to go. I have seen NO problems in compiling Greasemonkey extensions (amazingly) and getting them to work as they do in Greasemonkey.