脚本可以将脚本注入到其他Chrome:Windows? [英] Can Scriptish inject scripts into other chrome: windows?
问题描述
正如我们所知,Scriptish支持 chrome:
方案(虽然默认情况下是禁用的),但是却无法将用户脚本插入到其他chrome:window例如,下载窗口或关于窗口)。 使用 @include chrome:// foo / bar
编写脚本仅在浏览器窗口打开此页面时才起作用作为一个选项卡,而不是用这个URL的新窗口,除了浏览器窗口本身,使用 @include chrome://browser/content/browser.xul
可以工作。
有没有什么办法让Scriptish像
我已经解决了这个问题。
Scriptish会插入一个工具栏按钮浏览器窗口。每次它要注入一个脚本,它会检查目标是否活着,如果它有Scriptish的用户界面,如果没有,它只是返回。
因此,虽然它支持 chrome
方案,但它只在浏览器窗口中插入脚本,在标签页中插入chrome页面。
$ b code> modules \utils\Scriptish_injectScripts.js ,在第29行删除了这个检查,现在它可以将脚本注入为它们的 @include
元数据。
As we know Scriptish has the support for the chrome:
scheme (although disabled by default), but it failed to inject a user script into other chrome: window (for example, download window, or about window).
Writing a script using @include chrome://foo/bar
only works when the browser window opens this page as a tab, but not for a new window with this URL, except the browser window itself, use @include chrome://browser/content/browser.xul
does work.
Is there any way to let Scriptish do this just like what uc
does? Or is Scriptish just designed like this?
I have resolved it.
Scriptish will insert a toolbar button to browser windows. And every time it wants to inject a script, it checks if the target is alive and if it has Scriptish's UI, if not, it just return.
As a result, although it supports chrome
scheme, it only inject scripts into browser windows and chrome page in tabs.
I edited modules\utils\Scriptish_injectScripts.js
, removed this check at line 29, now it can inject scripts as their @include
meta data.
这篇关于脚本可以将脚本注入到其他Chrome:Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!