ACTCD
ACTCD
@quoid > I've tried it and errors get thrown when trying to _programmatically_ set clipboard data (ie. no user gesture). I think it will be a trend to block read...
@quoid I looked at the [official description of this function](https://wiki.greasespot.net/GM.setClipboard) and it doesn't seem to stress that this must be implemented programmatically, it looks like it just exists as an...
In my opinion, there should be no support for `txt` or other suffixes, that would create more confusion. In fact we should probably restrict it more strictly to `.user.js` and...
@fishjar 感谢你的评论。 正如我们在前面提到的,到目前为止,我们仍然没有办法在 Safari 中实现它。 由于缺乏必要的上游相关 API 支持。这对于所有 Safari Web 扩展都是一样。 如果您知道可以在 Safari 中正确实现它的某种方法,欢迎您告诉我们。 目前在 `页面上下文` 和 `扩展上下文` 之间只能通过事件传递可序列化对象。 我在上面提供的 [`示例`](https://github.com/quoid/userscripts/issues/252#issuecomment-1242540493) 则是按照推荐的更安全的方式提供的实现演示例。 即,使用随机名称的自定义事件替代默认的 [`window.postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#using_window.postmessage_in_extensions_non-standard) 事件: > Web context scripts can...
@fishjar 通过事件名称就可以做对应和区分了,提供的示例已经在两个方向上使用了不同的通道。 当然,您也可以通过消息内容对象的自定义键值做进一步区分,灵活性和方便性都足够。
@fishjar 是的,这就是我上面提到的[不同的扩展以不同的方式](https://github.com/quoid/userscripts/issues/252#issuecomment-1299560649)实现了该方法。包括是否真实注入到了页面上下文,也是存在实现差异。这也是我撰写上述评论的初衷,即我们不想再为这些已经存在的混乱添加更多的“自定义”兼容实现,制造更多混乱。 [`dispatchEvent`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent) 是 Event API 的标准方法,在页面和内容脚本范围都适用。您可以测试到我上面提供的示例脚本在 Firefox + Greasemonkey / FireMonkey 等环境中都是正常工作的。 也就是说该项目并没有添加任何差异实现,或造成进一步割裂的自定义实现。而这些也是为什么我建议不要再实现该 `unsafeWindow` 方法,以及使用推荐的通用方式制作示例用户脚本的原因。这是目前我们能够做的。
@fishjar No, it doesn't. You can see this in the [`README`](https://github.com/quoid/userscripts#api). If the project supports it, we will update API docs.
Since it cannot be fixed in this project. Close this issue. Maybe improved in the future in #424.
Historical updates have not been able to fix it. Future updates will avoid this issue. Close this issue.
@barart I haven't tried it, but you could.