一般的,出于安全性问题上的考虑,在 https 页面上不允许运行本地的用户脚本。这个考虑是很合理很必须的,但有时候我们却又需要在 https 上使用我们的脚本,那么我们应该怎么做呢?
方法有两个:一个是通过 Opera 自身的设置,另一个是将脚本打包成扩展(从去年发布的 Opera 11 alpha 开始支持)。
1、通过 Opera 自身的设置
Opera 本身是支持在 https 上使用脚本的,只是默认没有打开这个设置,我们可以在设置中将 opera:config#UserPrefs|UserJavaScriptonHTTPS 这项勾选,即可打开该功能。
如果仅仅是这样,又或是 Opera 在这上面花多点力气,那么也就没啥烦恼了(也许,可能,大概吧。。。你永远也无法预料那未知的神奇 bug)。原因就是下面这个对话框:

(你是否也被这个绝赞的对话框君治愈过?)
原本一个善意的提醒是多么的人性化,可它却不厌其烦的出现在你眼皮底下,不断的刷新你的容忍度上限,被人多次吐槽却没有改进过。明明是只要多一个“记住你的选择”复选框,亦或是多一个 config 设置项就能解决的问题啊 =.=!
2、打包成扩展
如果你是 Opera 11 alpha 之前的用户,那么这个方法不适用于你,因为你的浏览器不支持扩展,请自行另寻第三方软件来使用 UserJS。
Opera 扩展虽然算不上强,开放的接口也算不上多,但是打包起来却意外的简单。你仅仅需要准备这 3 件东西:config.xml、index.html 以及 includes 文件夹。
- 新建一个 config.xml 文本文件,按如下格式写入代码:
<?xml version='1.0' encoding='utf-8'?> <widget xmlns="http://www.w3.org/ns/widgets" version="1.0"> <name>addon name</name> <author>author name</author> <description xml:lang="en">description</description> </widget>
其中只有 widget 标签是必须的,但还是建议将其他都填完整。
- 新建一个 index.html 文本文件,内容可以为空,但该文件必须存在。
- 新建一个 includes 文件夹,将你的 UserJS 原封不动扔进去。
以上材料准备好后,即可按照下面结构打包成 zip 压缩包,然后将扩展名改为 .oex 即可。

安装后可在扩展管理界面中设置它的权限:

American Vogue breaks the stereotype of a Russian woman
cartola fc how to care for of age
Why can Angel Batista get away with wearing a fedora
kinox -4-free Net working Capital NWC
A Fashion Career Fashion Mysteries Explained
kinokiste how to cover your actual bottom combined with jacket
Cut the Macaca about George Allen
xvideos day trendy summer wearing exhibition launched
The Pros and Cons of Tension Set Wedding Rings
free hd porn Conditional on Tyrion asking for mercy at a guilty verdict
How to Make a Zed Card
black porn samurai a greater depth of kyo vol
Swiss Announces Race Team Initiative with Stand Up To Cancer
hd porn Dh likes anything other than au natural
Question about using Double Lease Options
weight loss tips leopard produce method
cartola fc how to care for of age
Why can Angel Batista get away with wearing a fedora
kinox -4-free Net working Capital NWC
A Fashion Career Fashion Mysteries Explained
kinokiste how to cover your actual bottom combined with jacket
Cut the Macaca about George Allen
xvideos day trendy summer wearing exhibition launched
The Pros and Cons of Tension Set Wedding Rings
free hd porn Conditional on Tyrion asking for mercy at a guilty verdict
How to Make a Zed Card
black porn samurai a greater depth of kyo vol
Swiss Announces Race Team Initiative with Stand Up To Cancer
hd porn Dh likes anything other than au natural
Question about using Double Lease Options
weight loss tips leopard produce method
伪娘的沙发~
第一種方式,可以用 https://bitbucket.org/xaxa/nocta/src/9313beb796c8 解決
這東西是附屬在xaNoCTA下的一個分支,目前使用上沒遇到什麼問題
改dll么,就算没问题也很麻烦额,每次更新都要改 = =
这个可恶的对话框…算了, 反正已经忍它很多年了…
想当年在opera10以下环境中, 默认选项竟然是否, 让无数习惯按回车的同学伤透了心…
现在好歹默认选项变了… :???:
打包成扩展的方法不错。。恩恩。学习了 :idea:
现在都不用JS了!!
:smile:
回家去试试谷哥加密搜索页面的跳转,那跳转可恶死了.
yysama 好贴心,蹭 :idea:
我想知道的是用hex编辑器的解决之道…
用扩展比userjs好的地方还有扩展可以直接把config.xml拖进opera开启调试模式,禁用启用重新加载都方便,也可以直接打开错误控制台
整了一个移除google搜索结果重定向的扩展,还在审核中。酱紫就不用操心https的问题了
好期待。。*_*!!
算了,还是点一下吧,封成扩展后有时不方便。
想问一下这样打包扩展includes 文件夹中只能有一个JS文件?我试过放进去三个,好像不起效用了……(这三个JS是比较相关的)
可以有多个
按照博主的步骤,仍然有提示框,难道我有步骤出错?我的js里有user.js,这是失效的原因吗?还是config.xml内容写错?求博主解答
那个对话框是由 opera:config#User JavaScript on HTTPS 控制的,跟扩展无关。关掉即可。