有没有办法在 Opera 小部件或扩展中运行外部程序?还有关于它在Linux下的编码问题

发布于 2024-10-08 13:30:02 字数 428 浏览 0 评论 0原文

我正在开发一个必须能够调用外部程序的扩展。
在firefox中,可以使用nsIProcess,而且非常简单。
但是opera的UserJS或者widget好像很弱,没有这个功能。
有一些解决办法吗?

另一个问题,我尝试使用协议处理程序。
这很奇怪,而且出现了奇怪的问题。

  1. 当传递给协议处理程序的 URL 中包含 %AE 等 UTF-8 字符时,
    无论是否使用 escape(),处理程序都无法接收到正确的 URL。
    我必须用一些奇怪的字符串替换 % 以避免这种情况。这确实是一个丑陋的解决方案。
    它只出现在Linux、opera 11.0中。
    我开始认为这是一个错误。
  2. 在 Opera Linux 中,它将把 URL 中的所有反斜杠替换为“/”。 我不想要这个,如何禁用它?

I'm working on an extension which must be able to call a external program.
In firefox, nsIProcess can be used and it's very easy.
But opera's UserJS or widget seems very weak and have no such function.
Is there some working around?

Another question, I tried to use protocols handlers.
It's just weird, and strange problems show up.

  1. When the URL passed to the protocol handler has UTF-8 character like %AE in it,
    whether escape() it or not, the handler cannot receive the correct URL.
    I have to replace % with some strange strings to avoid this. It's really a ugly solution.
    It only appears in Linux, opera 11.0.
    I'm starting to think it's a bug.
  2. In Opera Linux, it will replace all the backslash in URL with '/'.
    I don't want this, how to disable it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿咻 2024-10-15 13:30:02

关于问题的第二部分,您是否尝试过使用encodeURI()函数来转义您的URL?

Regarding the second part of your question, have you tried using the encodeURI() function for escaping your URLs?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文