Skip to content

Commit dec346d

Browse files
authored
Merge branch 'main' into deepsource-autofix-41753c47
2 parents 15067ab + a6d0a2e commit dec346d

17 files changed

Lines changed: 1237 additions & 615 deletions

File tree

.deepsource.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version = 1
2+
3+
[[analyzers]]
4+
name = "javascript"
5+
6+
[analyzers.meta]
7+
environment = ["browser", "es2020"]
8+
9+
# JS-0002: console usage is intentional in browser extension background/content
10+
# scripts where logging is the only debug channel available.
11+
# JS-0125: `browser` is the WebExtension runtime global injected by the host
12+
# browser (Safari/Firefox/Chrome) — it is not a project-level variable.
13+
# Both are false positives for this codebase and are suppressed via .eslintrc.json
14+
# (env.webextensions = true covers `browser`; no-console = off covers console calls).

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"webextensions": true,
5+
"es2020": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2020,
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
"no-console": "off"
13+
}
14+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ Carthage/Build/
5959
fastlane/report.xml
6060
fastlane/Preview.html
6161
fastlane/screenshots/**/*.png
62-
fastlane/test_output
62+
# Node / ESLint dev deps (only needed for local linting)
63+
node_modules/
64+
package-lock.json
65+

eslint.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// eslint.config.js — ESLint v9+ flat config
2+
// Mirrors .eslintrc.json for local development; DeepSource still reads .eslintrc.json.
3+
import globals from 'globals'
4+
5+
export default [
6+
{
7+
files: ['**/*.js'],
8+
languageOptions: {
9+
ecmaVersion: 2020,
10+
sourceType: 'module',
11+
globals: {
12+
...globals.browser,
13+
...globals.webextensions,
14+
browser: 'readonly'
15+
}
16+
},
17+
rules: {
18+
'no-console': 'off'
19+
}
20+
}
21+
]

ios/Flean.xcodeproj/project.pbxproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@
380380
isa = XCBuildConfiguration;
381381
buildSettings = {
382382
CODE_SIGN_STYLE = Automatic;
383-
CURRENT_PROJECT_VERSION = 1;
383+
CURRENT_PROJECT_VERSION = 2;
384384
DEVELOPMENT_ASSET_PATHS = extention;
385385
DEVELOPMENT_TEAM = PWL627GZ4Y;
386386
GENERATE_INFOPLIST_FILE = YES;
@@ -393,7 +393,7 @@
393393
"@executable_path/Frameworks",
394394
"@executable_path/../../Frameworks",
395395
);
396-
MARKETING_VERSION = 1.0;
396+
MARKETING_VERSION = 2.1.3;
397397
OTHER_LDFLAGS = (
398398
"-framework",
399399
SafariServices,
@@ -416,7 +416,7 @@
416416
isa = XCBuildConfiguration;
417417
buildSettings = {
418418
CODE_SIGN_STYLE = Automatic;
419-
CURRENT_PROJECT_VERSION = 1;
419+
CURRENT_PROJECT_VERSION = 2;
420420
DEVELOPMENT_ASSET_PATHS = extention;
421421
DEVELOPMENT_TEAM = PWL627GZ4Y;
422422
GENERATE_INFOPLIST_FILE = YES;
@@ -429,7 +429,7 @@
429429
"@executable_path/Frameworks",
430430
"@executable_path/../../Frameworks",
431431
);
432-
MARKETING_VERSION = 1.0;
432+
MARKETING_VERSION = 2.1.3;
433433
OTHER_LDFLAGS = (
434434
"-framework",
435435
SafariServices,
@@ -577,7 +577,7 @@
577577
CODE_SIGN_ENTITLEMENTS = Flean/Flean.entitlements;
578578
CODE_SIGN_STYLE = Automatic;
579579
COMBINE_HIDPI_IMAGES = YES;
580-
CURRENT_PROJECT_VERSION = 1;
580+
CURRENT_PROJECT_VERSION = 2;
581581
DEVELOPMENT_TEAM = PWL627GZ4Y;
582582
ENABLE_HARDENED_RUNTIME = YES;
583583
GENERATE_INFOPLIST_FILE = YES;
@@ -590,7 +590,7 @@
590590
"@executable_path/../Frameworks",
591591
);
592592
MACOSX_DEPLOYMENT_TARGET = 10.14;
593-
MARKETING_VERSION = 1.0;
593+
MARKETING_VERSION = 2.1.3;
594594
OTHER_LDFLAGS = (
595595
"-framework",
596596
SafariServices,
@@ -616,7 +616,7 @@
616616
CODE_SIGN_ENTITLEMENTS = Flean/Flean.entitlements;
617617
CODE_SIGN_STYLE = Automatic;
618618
COMBINE_HIDPI_IMAGES = YES;
619-
CURRENT_PROJECT_VERSION = 1;
619+
CURRENT_PROJECT_VERSION = 2;
620620
DEVELOPMENT_TEAM = PWL627GZ4Y;
621621
ENABLE_HARDENED_RUNTIME = YES;
622622
GENERATE_INFOPLIST_FILE = YES;
@@ -629,7 +629,7 @@
629629
"@executable_path/../Frameworks",
630630
);
631631
MACOSX_DEPLOYMENT_TARGET = 10.14;
632-
MARKETING_VERSION = 1.0;
632+
MARKETING_VERSION = 2.1.3;
633633
OTHER_LDFLAGS = (
634634
"-framework",
635635
SafariServices,
@@ -652,11 +652,11 @@
652652
buildSettings = {
653653
BUNDLE_LOADER = "$(TEST_HOST)";
654654
CODE_SIGN_STYLE = Automatic;
655-
CURRENT_PROJECT_VERSION = 1;
655+
CURRENT_PROJECT_VERSION = 2;
656656
DEVELOPMENT_TEAM = PWL627GZ4Y;
657657
GENERATE_INFOPLIST_FILE = YES;
658658
MACOSX_DEPLOYMENT_TARGET = 10.14;
659-
MARKETING_VERSION = 1.0;
659+
MARKETING_VERSION = 2.1.3;
660660
PRODUCT_BUNDLE_IDENTIFIER = slf.FleanTests;
661661
PRODUCT_NAME = "$(TARGET_NAME)";
662662
SWIFT_EMIT_LOC_STRINGS = NO;
@@ -670,11 +670,11 @@
670670
buildSettings = {
671671
BUNDLE_LOADER = "$(TEST_HOST)";
672672
CODE_SIGN_STYLE = Automatic;
673-
CURRENT_PROJECT_VERSION = 1;
673+
CURRENT_PROJECT_VERSION = 2;
674674
DEVELOPMENT_TEAM = PWL627GZ4Y;
675675
GENERATE_INFOPLIST_FILE = YES;
676676
MACOSX_DEPLOYMENT_TARGET = 10.14;
677-
MARKETING_VERSION = 1.0;
677+
MARKETING_VERSION = 2.1.3;
678678
PRODUCT_BUNDLE_IDENTIFIER = slf.FleanTests;
679679
PRODUCT_NAME = "$(TARGET_NAME)";
680680
SWIFT_EMIT_LOC_STRINGS = NO;
@@ -687,10 +687,10 @@
687687
isa = XCBuildConfiguration;
688688
buildSettings = {
689689
CODE_SIGN_STYLE = Automatic;
690-
CURRENT_PROJECT_VERSION = 1;
690+
CURRENT_PROJECT_VERSION = 2;
691691
DEVELOPMENT_TEAM = PWL627GZ4Y;
692692
GENERATE_INFOPLIST_FILE = YES;
693-
MARKETING_VERSION = 1.0;
693+
MARKETING_VERSION = 2.1.3;
694694
PRODUCT_BUNDLE_IDENTIFIER = slf.FleanUITests;
695695
PRODUCT_NAME = "$(TARGET_NAME)";
696696
SWIFT_EMIT_LOC_STRINGS = NO;
@@ -703,10 +703,10 @@
703703
isa = XCBuildConfiguration;
704704
buildSettings = {
705705
CODE_SIGN_STYLE = Automatic;
706-
CURRENT_PROJECT_VERSION = 1;
706+
CURRENT_PROJECT_VERSION = 2;
707707
DEVELOPMENT_TEAM = PWL627GZ4Y;
708708
GENERATE_INFOPLIST_FILE = YES;
709-
MARKETING_VERSION = 1.0;
709+
MARKETING_VERSION = 2.1.3;
710710
PRODUCT_BUNDLE_IDENTIFIER = slf.FleanUITests;
711711
PRODUCT_NAME = "$(TARGET_NAME)";
712712
SWIFT_EMIT_LOC_STRINGS = NO;
Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
1-
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
2-
console.log("Received request: ", request);
1+
import { getWikiData, fetchWikiData, findMatchingWiki, invalidateIndex } from './scripts/wiki-data-manager.js'
32

4-
if (request.greeting === "hello")
5-
return Promise.resolve({ farewell: "goodbye" });
6-
});
3+
// Initialise wiki data on extension startup (loads from cache or fetches fresh)
4+
async function initWikiData () {
5+
try {
6+
await getWikiData()
7+
} catch (err) {
8+
if (err) return
9+
}
10+
}
11+
12+
// Schedule a weekly background refresh using browser.alarms (if supported)
13+
function setupRefreshAlarm () {
14+
if (typeof browser === 'undefined' || !browser.alarms) return
15+
try {
16+
browser.alarms.create('wikiDataRefresh', { periodInMinutes: 7 * 24 * 60 })
17+
browser.alarms.onAlarm.addListener(async (alarm) => {
18+
if (alarm.name !== 'wikiDataRefresh') return
19+
try {
20+
await fetchWikiData()
21+
invalidateIndex()
22+
} catch (err) {
23+
if (err) return
24+
}
25+
})
26+
} catch (err) {
27+
if (err) return
28+
}
29+
}
30+
31+
browser.runtime.onMessage.addListener((request) => {
32+
if (request.greeting === 'hello') {
33+
return Promise.resolve({ farewell: 'goodbye' })
34+
}
35+
36+
if (request.action === 'findWiki') {
37+
return findMatchingWiki(request.url).catch(() => null)
38+
}
39+
40+
return undefined
41+
})
42+
43+
initWikiData()
44+
setupRefreshAlarm()

0 commit comments

Comments
 (0)