如何使用Chrome扩展使用Vanilla JS自定义当前网站光标?

发布于 2025-01-28 11:17:52 字数 445 浏览 1 评论 0原文

我正在为自定义光标开发此Chrome扩展程序,我有要应用于用户使用的网站文件的SVG路径。

  1. 我可以在我的JS代码中编写什么可以通过这些文件并将该SVG应用于光标?

  2. 如何将JS中产生的SVG路径链接到CSS文件? (由于该路径适用于HTML而不是CSS) 例如,这就是我得到的:< svg xmlns =“ http://www.w3.33.org/2000/svg” viewbox =“ 0 0 100 100 100” 45.5H-6.83C-1.09,0-2.116,0.273-3.019,0.748C-0.903-0.476-1.929-0.748--

  3. 0.903-0.476-1.929-0.748-所有站点“ subtest.json

I'm developing this Chrome Extension for Custom Cursors, I have the SVG path that I want to apply to the website's files that the user is using.

  1. What can I write in my JS code that can go through these files and apply that SVG for cursor?

  2. How could I link a an SVG path produced in my JS to a CSS file? (since the path is for applicable in HTML and not CSS)
    e.g. This is what I got: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M91.224,45.5h-6.83c-1.09,0-2.116,0.273-3.019,0.748c-0.903-0.476-1.929-0.748- ........

  3. Any permissions required other than "Access to all sites" in the manifest.json?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文