Skip to content

Commit e145a50

Browse files
committed
add smooth scroll
1 parent be94f46 commit e145a50

File tree

5 files changed

+920
-5
lines changed

5 files changed

+920
-5
lines changed

popup/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import { openModal } from "./helpers/modal.js";
2+
import { refreshSpecialTabs, getAllTabs } from "./tabs.js";
3+
import { checkForUpdate } from "./helpers/checkForUpdate.js";
4+
import { UfsGlobal } from "../scripts/content-scripts/ufs_global.js";
5+
import { THEME, THEME_KEY, getTheme, setTheme } from "./helpers/theme.js";
6+
import { run as enableSmoothScroll } from "../scripts/smoothScroll.js";
17
import {
28
isActiveScript,
39
getCurrentTab,
@@ -9,8 +15,6 @@ import {
915
checkBlackWhiteList,
1016
runScriptInTabWithEventChain,
1117
} from "../scripts/helpers/utils.js";
12-
import { UfsGlobal } from "../scripts/content-scripts/ufs_global.js";
13-
import { checkForUpdate } from "./helpers/checkForUpdate.js";
1418
import {
1519
LANG,
1620
LANG_KEY,
@@ -19,20 +23,17 @@ import {
1923
setLang,
2024
t,
2125
} from "./helpers/lang.js";
22-
import { openModal } from "./helpers/modal.js";
2326
import {
2427
activeTabIdSaver,
2528
favoriteScriptsSaver,
2629
recentScriptsSaver,
2730
} from "./helpers/storage.js";
28-
import { THEME, THEME_KEY, getTheme, setTheme } from "./helpers/theme.js";
2931
import {
3032
canAutoRun,
3133
canClick,
3234
isTitle,
3335
viewScriptSource,
3436
} from "./helpers/utils.js";
35-
import { refreshSpecialTabs, getAllTabs } from "./tabs.js";
3637
// import _ from "../md/exportScriptsToMd.js";
3738

3839
const settingsBtn = document.querySelector(".settings");
@@ -656,6 +657,7 @@ window.addEventListener("scroll", onScrollEnd);
656657
// #endregion
657658

658659
(async function () {
660+
enableSmoothScroll();
659661
trackEvent("OPEN-POPUP");
660662

661663
initTracking();

popup/tabs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ const tabs = [
480480
createTitle("--- Utility ---", "--- Tiện ích ---"),
481481
s.web_timer,
482482
s.auto_lockWebsite,
483+
s.smoothScroll,
483484
s.magnify_image,
484485
s.auto_redirectLargestImageSrc,
485486
s.remove_tracking_in_url,

scripts/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ import showFps_v2 from "./showFps_v2.js";
162162
import chongLuaDao from "./chongLuaDao.js";
163163
import prevent_closeBrowser_lastTab from "./prevent_closeBrowser_lastTab.js";
164164
import createInvisibleText from "./createInvisibleText.js";
165+
import smoothScroll from "./smoothScroll.js";
165166

166167
// inject badges
167168
const allScripts = {
@@ -343,6 +344,7 @@ const allScripts = {
343344
BADGES.new
344345
),
345346
createInvisibleText: addBadge(createInvisibleText, BADGES.new),
347+
smoothScroll: addBadge(smoothScroll, BADGES.new),
346348
};
347349

348350
// alert(Object.keys(allScripts).length);

0 commit comments

Comments
 (0)