Skip to content

Commit

Permalink
Fix Popup Scrolling (#45)
Browse files Browse the repository at this point in the history
* Fix Popup Scrolling with maxHeight, Update uninstallURL

* Fix for Chrome

* Misc Updates

* npm update
  • Loading branch information
smashedr authored May 26, 2024
1 parent 824548c commit d14295a
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 92 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Build'
name: "Build"

on:
workflow_dispatch:
Expand All @@ -7,15 +7,15 @@ on:

jobs:
build:
name: 'Build'
name: "Build"
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: 'Checkout'
- name: "Checkout"
uses: actions/checkout@v3

- name: 'Release Version Check'
- name: "Release Version Check"
if: ${{ github.event_name == 'release' }}
run: |
export version="$(jq '.version' < manifest.json | tr -d '"')"
Expand All @@ -24,23 +24,23 @@ jobs:
exit 1
fi
- name: 'Setup Node'
- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: 18

- name: 'Build All'
- name: "Build All"
run: |
npm install
npm run build
- name: 'Upload to Actions'
- name: "Upload to Actions"
uses: actions/upload-artifact@v3
with:
name: artifacts
path: web-ext-artifacts/

- name: 'Upload to Release'
- name: "Upload to Release"
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: 'Test'
name: "Test"

on:
push:
branches: ['master']
branches: ["master"]
pull_request:
branches: ['master']
branches: ["master"]
workflow_dispatch:

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

steps:
- name: 'Checkout'
- name: "Checkout"
uses: actions/checkout@v3

- name: 'Setup Node 18'
- name: "Setup Node 18"
uses: actions/setup-node@v3
with:
node-version: 18

- name: 'Lint'
- name: "Lint"
run: |
npm install
npm run manifest:firefox
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"singleQuote": true,
"overrides": [
{
"files": ["**/*.html"],
"files": ["**/*.html", "**/*.yaml"],
"options": {
"singleQuote": false
}
Expand Down
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ All Chromium Based Browsers can install the extension from the

* View Recent Uploads on Popup
* Preview Popup Images on Hover.
* Set Private, Password, and Expiration.
* Right Click any Image, Video, or Audio to Upload.
* Right Click any URL to Shorten.
* Automatically Auth with Django Files.
* Automatic Dark/Light Mode based on Browser Settings.
* Automatically Auth with Django Files.

> [!TIP]
> **Don't see your feature here?**
Expand Down Expand Up @@ -81,45 +82,52 @@ Alternatively, you can open the Options page and add your URL and Token.

**Quick Start**

To run chrome or firefox with web-ext.
First, clone (or download) this repository and change into the directory:
```shell
git clone https://github.com/django-files/web-extension.git
cd web-extension
```

Second, install the dependencies:
```shell
npm isntall
```

Finally, to run Chrome or Firefox with web-ext, run one of the following:
```shell
npm run chrome
npm run firefox
```

To Load Unpacked/Temporary Add-on make a `manifest.json` with.
Additionally, to Load Unpacked/Temporary Add-on make a `manifest.json` and run from the [src](src) folder, run one of the following:
```shell
npm run manifest:chrome
npm run manifest:firefox
```

Chrome: [https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked)
Firefox: [https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/)

For more information on web-ext, [read this documentation](https://extensionworkshop.com/documentation/develop/web-ext-command-reference/).
To pass additional arguments to an `npm run` command, use `--`.
Example: `npm run chrome -- --chromium-binary=...`

## Building

Install the requirements and copy libraries into the `src/dist` directory by running `npm install`.
See [gulpfile.js](gulpfile.js) for more information on postinstall.
See [gulpfile.js](gulpfile.js) for more information on `postinstall`.
```shell
npm install
```

To load unpacked or temporary addon from the [src](src) folder, you must generate the `src/manifest.json` for the desired browser.
```shell
npm run manifest:chrome
npm run manifest:firefox
```

If you would like to create a `.zip` archive of the [src](src) directory for the desired browser.
To create a `.zip` archive of the [src](src) directory for the desired browser run one of the following:
```shell
npm run build
npm run build:chrome
npm run build:firefox
```

For more information on building, see the scripts in the [package.json](package.json) file.
For more information on building, see the scripts section in the [package.json](package.json) file.

## Chrome Setup

Expand All @@ -140,8 +148,7 @@ it is very useful to keep addon storage after uninstall/restart with `keepStorag
1. Navigate to the folder you extracted earlier, select `manifest.json` then click `Select File`.
1. Open `about:config` search for `extensions.webextensions.keepStorageOnUninstall` and set to `true`.

If you need to test a build or browser restart, you must pack the addon.
This only works in ESR, Development, or Nightly.
If you need to test a restart, you must pack the addon. This only works in ESR, Development, or Nightly.

1. Run `npm run build:firefox` then use `web-ext-artifacts/{name}-firefox-{version}.zip`.
1. Open `about:config` search for `xpinstall.signatures.required` and set to `false`.
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 3,
"version": "0.4.6",
"version": "0.4.7",
"name": "Django Files",
"description": "Django Files Web Extension designed to work with github.com/django-files/django-files.",
"homepage_url": "https://github.com/django-files/web-extension",
Expand Down
Loading

0 comments on commit d14295a

Please sign in to comment.