Skip to content

Commit 9b9ac40

Browse files
authored
Fixes (#39)
* Fix Firefox Startup * Revert Commit to Master This reverts commit ef92c28. * Fix Firefox Startup, Prettier * Update Options Links * Bump Version
1 parent e3a7f5c commit 9b9ac40

File tree

7 files changed

+46
-24
lines changed

7 files changed

+46
-24
lines changed

.eslintrc.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
},
88
"extends": "eslint:recommended",
99
"parserOptions": {
10-
"ecmaVersion": "latest"
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
1112
},
1213
"rules": {
14+
"no-empty": "off",
1315
"no-extra-semi": "off",
14-
"no-undef": "off"
16+
"no-func-assign": "off",
17+
"no-undef": "off",
18+
"no-unused-vars": "off"
1519
}
1620
}

.github/workflows/build.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Build"
1+
name: 'Build'
22

33
on:
44
workflow_dispatch:
@@ -7,15 +7,15 @@ on:
77

88
jobs:
99
build:
10-
name: "Build"
10+
name: 'Build'
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 5
1313

1414
steps:
15-
- name: "Checkout"
15+
- name: 'Checkout'
1616
uses: actions/checkout@v3
1717

18-
- name: "Release Version Check"
18+
- name: 'Release Version Check'
1919
if: ${{ github.event_name == 'release' }}
2020
run: |
2121
export version="$(jq '.version' < manifest.json | tr -d '"')"
@@ -24,23 +24,23 @@ jobs:
2424
exit 1
2525
fi
2626
27-
- name: "Setup Node"
27+
- name: 'Setup Node'
2828
uses: actions/setup-node@v3
2929
with:
3030
node-version: 18
3131

32-
- name: "Build All"
32+
- name: 'Build All'
3333
run: |
3434
npm install
3535
npm run build
3636
37-
- name: "Upload to Actions"
37+
- name: 'Upload to Actions'
3838
uses: actions/upload-artifact@v3
3939
with:
4040
name: artifacts
4141
path: web-ext-artifacts/
4242

43-
- name: "Upload to Release"
43+
- name: 'Upload to Release'
4444
uses: svenstaro/upload-release-action@v2
4545
with:
4646
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
name: "Test"
1+
name: 'Test'
22

33
on:
44
push:
5-
branches: ["master"]
5+
branches: ['master']
66
pull_request:
7-
branches: ["master"]
7+
branches: ['master']
88
workflow_dispatch:
99

1010
jobs:
1111
test:
12-
name: "Test"
12+
name: 'Test'
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 5
1515
if: ${{ !contains(github.event.head_commit.message, '[CI SKIP]') }}
1616

1717
steps:
18-
- name: "Checkout"
18+
- name: 'Checkout'
1919
uses: actions/checkout@v3
2020

21-
- name: "Setup Node 18"
21+
- name: 'Setup Node 18'
2222
uses: actions/setup-node@v3
2323
with:
2424
node-version: 18
2525

26-
- name: "Lint"
26+
- name: 'Lint'
2727
run: |
2828
npm install
2929
npm run manifest:firefox

.prettierrc.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
22
"trailingComma": "es5",
3-
"semi": false,
43
"tabWidth": 4,
4+
"semi": false,
5+
"singleQuote": true,
56
"overrides": [
67
{
7-
"files": ["**/*.js"],
8+
"files": ["**/*.html"],
89
"options": {
9-
"singleQuote": true
10+
"singleQuote": false
1011
}
1112
},
1213
{
13-
"files": ["**/*.json"],
14+
"files": ["**/*.json", "**/*.yaml"],
1415
"options": {
1516
"tabWidth": 2
1617
}

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 3,
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"name": "Django Files",
55
"description": "Django Files Web Extension designed to work with github.com/django-files/django-files.",
66
"homepage_url": "https://github.com/django-files/web-extension",

src/html/options.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ <h1>Django Files Options</h1>
128128
<hr>
129129
<div class="text-center">
130130
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
131-
href="https://github.com/django-files/chrome-extension#readme">Get Help</a>
131+
href="https://github.com/django-files/web-extension?tab=readme-ov-file#readme">Get Help</a>
132132
<svg><use xlink:href="#bi-dot" /></svg>
133133
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
134-
href="https://github.com/django-files/chrome-extension">View Source</a>
134+
href="https://github.com/django-files/web-extension/issues">Open Issue</a>
135135
<svg><use xlink:href="#bi-dot" /></svg>
136136
<a class="link-body-emphasis text-decoration-none" target="_blank" rel="noopener"
137137
href="https://django-files.github.io/">Django Files</a>

src/js/service-worker.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
// JS Background Service Worker
22

3+
chrome.runtime.onStartup.addListener(onStartup)
34
chrome.runtime.onInstalled.addListener(onInstalled)
45
chrome.contextMenus.onClicked.addListener(contextMenusClicked)
56
chrome.notifications.onClicked.addListener(notificationsClicked)
67
chrome.storage.onChanged.addListener(onChanged)
78

9+
/**
10+
* On Startup Callback
11+
* @function onStartup
12+
*/
13+
async function onStartup() {
14+
console.log('onStartup')
15+
if (typeof browser !== 'undefined') {
16+
console.log('Firefox CTX Menu Workaround')
17+
const { options } = await chrome.storage.sync.get(['options'])
18+
console.debug('options:', options)
19+
if (options.contextMenu) {
20+
createContextMenus()
21+
}
22+
}
23+
}
24+
825
/**
926
* On Installed Callback
1027
* @function onInstalled

0 commit comments

Comments
 (0)