Skip to content

Commit

Permalink
Updates (#25)
Browse files Browse the repository at this point in the history
* Updates

* Overhaul Permissions Handling

* Update Badges

* Update UninstallURL

* Add popper to oninstall

* Simplify Host Permissions Entry to <all_urls>

* Overhaul Options and MutationObserver
  • Loading branch information
smashedr authored May 29, 2024
1 parent 535217f commit a1ae887
Show file tree
Hide file tree
Showing 15 changed files with 471 additions and 479 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

- name: "Release Version Check"
if: ${{ github.event_name == 'release' }}
Expand All @@ -25,17 +25,17 @@ jobs:
fi
- name: "Setup Node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: "Build All"
run: |
npm install
npm run build
- name: "Upload to Actions"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifacts
path: web-ext-artifacts/
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"singleQuote": true,
"overrides": [
{
"files": ["**/*.html"],
"files": ["**/*.html", "**/*.yaml"],
"options": {
"singleQuote": false
}
},
{
"files": ["**/*.json"],
"files": ["**/*.json", "**/*.yaml"],
"options": {
"tabWidth": 2
}
Expand Down
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Chrome Web Store Users](https://img.shields.io/chrome-web-store/users/efahmjakjnnmleokcaomicgfhobabdkc?logo=google&logoColor=white&label=google%20users)](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc)
[![Mozilla Add-on Users](https://img.shields.io/amo/users/open-links-in-new-tab?logo=mozilla&label=mozilla%20users)](https://addons.mozilla.org/addon/open-links-in-new-tab)
[![Chrome Web Store Rating](https://img.shields.io/chrome-web-store/rating/efahmjakjnnmleokcaomicgfhobabdkc?logo=google&logoColor=white)](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc)
[![Mozilla Add-on Rating](https://img.shields.io/amo/rating/open-links-in-new-tab?logo=mozilla&logoColor=white)](https://addons.mozilla.org/addon/open-links-in-new-tab)
[![Chrome Web Store Version](https://img.shields.io/chrome-web-store/v/efahmjakjnnmleokcaomicgfhobabdkc?label=chrome&logo=googlechrome)](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc)
[![Mozilla Add-on Version](https://img.shields.io/amo/v/open-links-in-new-tab?label=firefox&logo=firefox)](https://addons.mozilla.org/addon/open-links-in-new-tab)
[![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/open-links-in-new-tab?logo=github)](https://github.com/cssnr/open-links-in-new-tab/releases/latest)
Expand Down Expand Up @@ -29,13 +31,9 @@ Modern Chrome Web Extension and Firefox Browser Addon to Open Links in New Tabs
[![Vivaldi](https://raw.githubusercontent.com/alrra/browser-logos/main/src/vivaldi/vivaldi_48x48.png)](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc)
[![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png)](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc)

All Chromium Based Browsers can install the extension from the
All **Chromium** Based Browsers can install the extension from the
[Chrome Web Store](https://chromewebstore.google.com/detail/open-links-in-new-tab/efahmjakjnnmleokcaomicgfhobabdkc).

Advanced Users can:
* Download the latest [Chrome Release](https://github.com/cssnr/open-links-in-new-tab/releases/latest/download/open_links_in_new_tab-chrome.crx) from GitHub
* Download the latest [Firefox Release](https://github.com/cssnr/open-links-in-new-tab/releases/latest/download/open_links_in_new_tab-firefox.xpi) from GitHub

# Features

Please submit a [Feature Request](https://github.com/cssnr/open-links-in-new-tab/discussions/new?category=feature-requests) for new features.
Expand Down Expand Up @@ -71,19 +69,28 @@ To open the options, click on the icon (from above) then click `Open Options`.

**Quick Start**

To run chrome or firefox with web-ext.
First, clone (or download) this repository and change into the directory.

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

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

To Load Unpacked/Temporary Add-on make a `manifest.json` and run from the [src](src) folder.
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=...`
Expand All @@ -96,20 +103,14 @@ See [gulpfile.js](gulpfile.js) for more information on `postinstall`.
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 @@ -121,17 +122,14 @@ For more information on building, see the scripts in the [package.json](package.

## Firefox Setup

Note: Firefox Temporary addon's will **not** remain after restarting Firefox, therefore;
it is very useful to keep addon storage after uninstall/restart with `keepStorageOnUninstall`.

1. Build or Download a [Release](https://github.com/cssnr/open-links-in-new-tab/releases).
1. Unzip the archive, place the folder where it must remain and note its location for later.
1. Go to `about:debugging#/runtime/this-firefox` and click `Load Temporary Add-on...`
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.
You may also use an Unbranded Build: [https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds](https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds)

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
7 changes: 4 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"manifest_version": 3,
"version": "0.1.8",
"version": "0.2.0",
"name": "Open Links in New Tab",
"short_name": "Open in Tab",
"description": "Modern Web Extension to Open Links in New Tabs for Specified Domains or Temporarily on Any Tab.",
"homepage_url": "https://github.com/cssnr/open-links-in-new-tab",
"homepage_url": "https://open-links-in-new-tab.cssnr.com/",
"author": "Shane",
"commands": {
"_execute_action": {
Expand All @@ -26,7 +27,7 @@
}
},
"permissions": ["activeTab", "contextMenus", "scripting", "storage"],
"host_permissions": ["https://*/*", "http://*/*"],
"host_permissions": ["<all_urls>"],
"content_scripts": [
{
"matches": ["<all_urls>"],
Expand Down
Loading

0 comments on commit a1ae887

Please sign in to comment.