github / github/text-expander-element

`provide` function unavailable in Firefox content scripts context

未关闭
#51 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
228
派生
32
平均合并
1 天 6 小时
30 天内合并 PR
5

描述

Our team is trying to write a browser extension to create an autocomplete search feature inside Github for a 3rd party issue tracking system.

We almost have it working on Chrome, but on Firefox the [content security limitations of content scripts](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts#xray_vision_in_firefox) is preventing us from making this work.

The issue is that the [`provide`](https://github.com/github/text-expander-element/blob/main/src/text-expander-element.ts#L250-L252) function sent in the detail object of the `text-expander-change` `CustomEvent` is not accessible inside the Firefox content script.

We would appreciate any refactor that would allow us to use this component without any passthrough functions or DOM fragments.

贡献指南

打开贡献指南

调研方向

首先阅读第250-252行附近的src/text-expander-element.ts中的provide function,并检查它是如何通过text-expander-change CustomEvent传递的。在Firefox content script中复现该行为,然后确定一种避免passthrough functions和DOM fragments,同时保留组件autocomplete行为的方法。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend, web-dev
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。