Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔴 可以考虑推出 Tampermonkey 版本 #171

Open
Thomas-Harrell opened this issue Sep 27, 2024 · 0 comments
Open

🔴 可以考虑推出 Tampermonkey 版本 #171

Thomas-Harrell opened this issue Sep 27, 2024 · 0 comments

Comments

@Thomas-Harrell
Copy link

Thomas-Harrell commented Sep 27, 2024



  • 直接在 Tampermonkey 脚本里面远程调用 content.js 文件就可以了

  • Tampermonkey 脚本比浏览器插件要轻量高效,还可以自动更新(相较于下载插件到本地)

  • 同时还免去了 Google Web Store 审核插件的步骤,现在 Google Web Store 里面的插件还是旧版的(v1.07-2024.06.02

  • 现行 Greasy Fork 有一个他人添加的 JS 脚本,不过已经没有在维护更新了


  • 用 GPT 尝试性写了一个 JS 脚本,是可以正常运行的
// ==UserScript==
// @name         FigmaCN
// @match        *://*.figma.com/*
// @version      1.2.4
// @homepageURL  https://github.com/Figma-Cool/figmaCN
// @grant        GM_xmlhttpRequest
// ==/UserScript==

(function() {
    'use strict';

    GM_xmlhttpRequest({
        method: 'GET',
        url: 'https://raw.githubusercontent.com/Figma-Cool/figmaCN/refs/heads/master/js/content.js',
        onload: function(response) {
            if (response.status === 200) {
                eval(response.responseText);
            } else {
                console.error('Failed to load script:', response.status);
            }
        }
    });
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant