Mr-Quin / danmaku-anywhere

一个可以在任何视频网站上加载弹幕的浏览器插件 | A browser extension that injects danmaku into any video
https://danmaku.weeblify.app/getting-started/
Other
132 stars 1 forks source link

Request for host permission at install time #21

Closed Mr-Quin closed 6 months ago

Mr-Quin commented 6 months ago

Continued from #17

Right now the only required host permission is https://*.dandanplay.net/*. Other host permissions are requested when user creates mount configs for their websites, and removed when the configs are deleted. This creates a problem where required permission might be inadvertently removed by the user:

  1. User creates a mount config with pattern *//*/*
  2. The permission for *//*/* is requested and added
  3. When the mount config is removed, the pattern *//*/* is removed, but it will also remove all other host permissions because *//*/* matches everything else.
  4. The extension stops working because the required permission https://*.dandanplay.net/* is also removed.

We should not allow user to modify host permission in the UI and instead request for *://*/* permission at install time. We can still dynamically inject the content script only into websites specified in mount configs.

Mr-Quin commented 6 months ago

Changed in v0.10.0