Skip to content

出问题了,平板上也有,重启了没有,可能是bug? #29

@woshishuaige13

Description

@woshishuaige13

替换背景图片的插件老出现这个是什么原因啊?重启插件就没了,平板上也有这个问题,平板上也容易黑屏。

Image

Activity

HowcanoeWang

HowcanoeWang commented on Apr 7, 2025

@HowcanoeWang
Owner

看图没有get到是什么问题,是否能提供更多细节?

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

就是这个你看到的图片会把软件的上层挤下来然后,原本的背景图片就失效了,

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

我是全屏用的

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

这个就是上面的部分

HowcanoeWang

HowcanoeWang commented on Apr 7, 2025

@HowcanoeWang
Owner

使用默认主题或者其他主题也会这样吗

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

emmm不太清楚默认主题会怎么样,[積読]我用的这个

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

以前没出现过啊,最近才有的,比较频繁了

woshishuaige13

woshishuaige13 commented on Apr 7, 2025

@woshishuaige13
Author

我一直是一键更新的,不知道是哪的问题了

HowcanoeWang

HowcanoeWang commented on Apr 8, 2025

@HowcanoeWang
Owner

换成默认主题再看看?先排除一下是 積読 主题更新的影响

zesicus

zesicus commented on Apr 9, 2025

@zesicus

这个问题我在论坛反馈过了,可惜 D 大没有就此进行回复。
因为插件没有更新,在思源更新到 3.1.26 后,就发现了这个问题。
当前我使用的是Asri这个主题,但是在原生主题上依然有这个问题。
目前思源更新到 3.1.27,问题依然存在...

换成默认主题再看看?先排除一下是 積読 主题更新的影响

woshishuaige13

woshishuaige13 commented on Apr 9, 2025

@woshishuaige13
Author

可以去交流群给客服反映一下

HowcanoeWang

HowcanoeWang commented on Apr 9, 2025

@HowcanoeWang
Owner

我平时一直用的是Asri主题,一直没问题,没想到原生主题都能出问题,我抽空看看应该怎么整

HowcanoeWang

HowcanoeWang commented on Apr 10, 2025

@HowcanoeWang
Owner

在论坛帖子里回复了定位的问题,可能是更新了electron版本,有过一阵子丢失插件css样式的bug

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner
TCOTC

TCOTC commented on Apr 11, 2025

@TCOTC

出问题的情况下,插件 CSS 是只丢了这一个还是整个全丢了?

TCOTC

TCOTC commented on Apr 11, 2025

@TCOTC

可以试一下给 style 的 id 添加 snippetCSS- 前缀,看看之后还会不会出现这个问题

Image

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

对的,正常情况下,head标签里面有这个:

<style id="pluginsStylesiyuan-plugin-background-cover">/*!
...
.bglayer{background-repeat:no-repeat;background-attachment:fixed;background-size:cover;background-position:center center;width:100%;height:100%;position:absolute;z-index:-10000}.b3-slider::-webkit-slider-runnable-track,.b3-slider::-moz-range-track,.b3-slider::-ms-fill-lower,.b3-slider::-ms-fill-upper{background-color:blue}
</style>

然后出问题之后,这个style就整个从head里面消失了

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

然后还有一个,看console日志,bug触发时,插件同时会重载,重载后css丢失

还观察到,似乎是触发数据同步会同时触发插件重载

大概率和 #27 相关

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

@woshishuaige13 @zesicus 你们有使用官方的云同步或多设备同步吗

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

可以试一下给 style 的 id 添加 snippetCSS- 前缀,看看之后还会不会出现这个问题

Image

指放弃使用默认引入,自己写一个引入的代码吗?

export async function onload() {
    // 创建style元素
    const style = document.createElement('style');
    style.id = 'snippetCSS-pluginsStylesiyuan-plugin-background-cover';
    
    // 加载CSS内容
    const cssResponse = await fetch('./index.scss');
    const cssText = await cssResponse.text();
    style.textContent = cssText;
    
    // 添加到head
    document.head.appendChild(style);
}
TCOTC

TCOTC commented on Apr 11, 2025

@TCOTC

bug触发时,插件同时会重载,重载后css丢失

麻烦看一下在这个过程中插件有没有正确卸载了再打开

zesicus

zesicus commented on Apr 11, 2025

@zesicus

@woshishuaige13 @zesicus 你们有使用官方的云同步或多设备同步吗

没有用官方的,用的七牛云S3同步的

wuseng55

wuseng55 commented on Apr 11, 2025

@wuseng55

@woshishuaige13 @zesicus 你们有使用官方的云同步或多设备同步吗

也是更新了 3.1.26后频繁出现这个问题,主要使用的主题asri和midnight都出现过,使用同步是aliyun的S3

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

对的,正常情况下,head标签里面有这个:

<style id="pluginsStylesiyuan-plugin-background-cover">/*! ... .bglayer{background-repeat:no-repeat;background-attachment:fixed;background-size:cover;background-position:center center;width:100%;height:100%;position:absolute;z-index:-10000}.b3-slider::-webkit-slider-runnable-track,.b3-slider::-moz-range-track,.b3-slider::-ms-fill-lower,.b3-slider::-ms-fill-upper{background-color:blue} </style>

然后出问题之后,这个style就整个从head里面消失了

添加了之后,倒是这个<style>标签本事是不会丢失了,但是内容会变空白所以还是没啥用

Image

TCOTC

TCOTC commented on Apr 11, 2025

@TCOTC

好怪,麻烦给思源提 issue 看看

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

好怪,麻烦给思源提 issue 看看

我这边倒是可以不用css文件,直接把样式写死在<canvas style="...">里面来解决这个问题,但是为什么旧版本 import css没问题,新版本就出问题了很费解

TCOTC

TCOTC commented on Apr 11, 2025

@TCOTC

提 issue 说明一下重现问题的流程和问题的表现

HowcanoeWang

HowcanoeWang commented on Apr 11, 2025

@HowcanoeWang
Owner

暂时通过把css样式直接写入到style里面来临时修复这个问题

///////////////////////////////////////////////
// 载入scss修复思源笔记v3.1.26重载插件会丢失的bug //
///////////////////////////////////////////////
// bgLayer.className = "bglayer";
// 直接设置样式
bgLayer.style.backgroundRepeat = 'no-repeat';
bgLayer.style.backgroundAttachment = 'fixed';
bgLayer.style.backgroundSize = 'cover';
bgLayer.style.backgroundPosition = 'center center';
bgLayer.style.width = '100%';
bgLayer.style.height = '100%';
bgLayer.style.position = 'absolute';
bgLayer.style.zIndex = '-10000';

后续还需等待 #27siyuan-note/siyuan#14579 的反馈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zesicus@HowcanoeWang@TCOTC@wuseng55@woshishuaige13

        Issue actions

          出问题了,平板上也有,重启了没有,可能是bug? · Issue #29 · HowcanoeWang/siyuan-plugin-background-cover