Skip to content

Commit

Permalink
修正init 函数中缩进
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Feb 15, 2025
1 parent cfdf57d commit 8ae59ca
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions main.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,20 +635,20 @@

// 监听 Turbo 获取响应之前事件
document.addEventListener('turbo:before-fetch-response', () => {
pageConfig.firstChangeURL = true; // 页面开始切换前设置为 true
});
pageConfig.firstChangeURL = true; // 页面开始切换前设置为 true
});

// 监听 Turbo 完成事件(延迟翻译)
document.addEventListener('turbo:load', () => {
if (!pageConfig.currentPageType) return;
// 监听 Turbo 完成事件(延迟翻译)
document.addEventListener('turbo:load', () => {
if (!pageConfig.currentPageType) return;

transTitle(); // 翻译页面标题
transBySelector();
transTitle(); // 翻译页面标题
transBySelector();

if (FeatureSet.enable_transDesc && CONFIG.DESC_SELECTORS[pageConfig.currentPageType]) {
transDesc(CONFIG.DESC_SELECTORS[pageConfig.currentPageType]);
}
});
if (FeatureSet.enable_transDesc && CONFIG.DESC_SELECTORS[pageConfig.currentPageType]) {
transDesc(CONFIG.DESC_SELECTORS[pageConfig.currentPageType]);
}
});

// 初始化菜单
registerMenuCommand();
Expand Down

0 comments on commit 8ae59ca

Please sign in to comment.