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

能不能增加一个选项,允许关闭鼠标经过链接时的链接自动预览? #3570

Closed
hellodk34 opened this issue Jun 14, 2024 · 4 comments · Fixed by #3647
Closed
Labels
enhancement New feature or request Stale

Comments

@hellodk34
Copy link

Describe the solution you'd like

能不能增加一个选项,允许关闭鼠标经过链接时的链接自动预览?

目前的自动预览感觉很影响 memo 的观感,那个链接会被自动预览,而我不需要这样的功能,然后会占据页面元素影响了memo 本身其他文字内容的显示。最关键的是在鼠标移除之后自动预览的链接内容并没有自动消失,反而占据了原本位置,很影响阅读。

Type of feature

User Experience (UX)

Additional context

image

@hellodk34 hellodk34 added the enhancement New feature or request label Jun 14, 2024
@Issues-translate-bot
Copy link

Issue is not in English. It has been translated automatically.


Title: Can you add an option that allows you to turn off the automatic preview of links when the mouse passes over them?

Describe the solution you'd like

Can you add an option to turn off the automatic link preview when the mouse passes over the link?

The current automatic preview seems to affect the look and feel of the memo. The link will be automatically previewed, and I don't need such a function. Then it will occupy the page elements and affect the display of other text content in the memo itself. The most important thing is that the automatically previewed link content does not disappear automatically after the mouse is removed. Instead, it occupies the original position, which greatly affects reading.

Type of feature

User Experience (UX)

Additional context

image

@yihanglee-cn
Copy link

我通过自定义JS阻止了GetLinkMetaData API,参考代码如下:

window.fetch = new Proxy(window.fetch, {
    apply(target, thisArg, args) {
        const url = args[0];
        // 检查请求的URL是否是我们想要阻止的API
        if (url.includes('/memos.api.v1.MarkdownService/GetLinkMetadata')) {
            // 返回一个空的Promise,模拟请求被取消
            return Promise.resolve({
                ok: true,
                json: () => Promise.resolve({}),
            });
        }
        // 如果不是我们要阻止的请求,就正常执行Fetch
        return target.apply(thisArg, args);
    }
});

@hellodk34
Copy link
Author

@yihanglee-cn 感谢分享,我使用了你的代码也成功了。

就是很奇怪,保存了好几次这段自定义 JS 代码都没有生效,重新回到设置里自定义 JS 那部分设置又变空了。。

最后一次保存应该是我切换了几个设置项 tab 之后填入再保存,最终保存成功,在浏览 memos 时且能生效。再次感谢

@Issues-translate-bot
Copy link

Issue is not in English. It has been translated automatically.


@yihanglee-cn Thanks for sharing, I used your code and it was successful.

It's just weird. I saved this custom JS code several times but it didn't take effect. When I went back to the settings to customize JS, the settings became empty again. .

The last save should be when I switched several settings tabs and then filled in and saved. The final save was successful and it took effect when browsing memos. Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants