We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在开启cookieconsent的同时,如果使用I don't care about cookie之类的浏览器插件访问网站,或者因为其他原因(例如单独配置的CDN失效)导致cookieconsent.min.js无法加载时,会导致页面的目录和回到顶部按钮不显示。
根据报错可以定位到是由于theme.js中,当cookieconsent加载失败时,抛出异常导致后续步骤无法执行。
init() { try { if (this.config.encryption) { this.initFixItDecryptor(); } else if (!this.config.encryption?.all) { this.initTwemoji(); this.initDetails(); this.initLightGallery(); this.initHighlight(); this.initTable(); this.initHeaderLink(); this.initMath(); this.initMermaid(); this.initEcharts(); this.initTypeit(); this.initMapbox(); this.initPangu(); } this.initThemeColor(); this.initSVGIcon(); this.initMenu(); this.initSwitchTheme(); this.initSearch(); this.initCookieconsent();//here this.initSiteTime(); this.initServiceWorker(); this.initWatermark(); this.initMDevtools(); this.initAutoMark(); this.initReward(); window.setTimeout(() => { this.initComment(); if (!this.config.encryption?.all) { this.initToc(); this.initTocListener(); } this.onScroll(); this.onResize(); this.onClickMask(); this.beforeprint(); }, 100); } catch (err) { console.error(err); } }
对于cookieConsent这类提供额外功能且独立于其他部分的第三方资源的初始化过程,是否可以改为异步执行以避免某个模块的资源加载失败导致影响页面功能?
这应该也有助于提供页面加载速度。
No response
The text was updated successfully, but these errors were encountered:
先修复 cookie consent 加载失败导致的阻断报错,第三方资源初始化改为异步执行进程延后,后续版本 JS 整体重构再考虑。
Sorry, something went wrong.
6cbb898
Lruihao
No branches or pull requests
Describe the bug 描述你遇到的错误
在开启cookieconsent的同时,如果使用I don't care about cookie之类的浏览器插件访问网站,或者因为其他原因(例如单独配置的CDN失效)导致cookieconsent.min.js无法加载时,会导致页面的目录和回到顶部按钮不显示。
根据报错可以定位到是由于theme.js中,当cookieconsent加载失败时,抛出异常导致后续步骤无法执行。
Expected behavior 期待的行为
对于cookieConsent这类提供额外功能且独立于其他部分的第三方资源的初始化过程,是否可以改为异步执行以避免某个模块的资源加载失败导致影响页面功能?
这应该也有助于提供页面加载速度。
Screenshots 屏幕截图
Build Environment 构建环境
No response
Preview Environment 预览环境
No response
Additional Information 补充信息
No response
The text was updated successfully, but these errors were encountered: