Skip to content

Commit

Permalink
Port for Firefox (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkelM authored Jun 2, 2023
1 parent e07033d commit c1fd5c9
Show file tree
Hide file tree
Showing 37 changed files with 8,429 additions and 961 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
extension
test
dev
node_modules
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ jobs:
- name: Build extension
run: npm run build

- name: Create .zip of required files
- name: Create .zip of chromium build
run: |
cd dist
zip -r ../Random.Youtube.Video.zip *
cd dist/chromium
zip -r ../Random.Youtube.Video.chromium.zip *
- name: Create .zip of firefox build
run: |
cd dist/firefox
zip -r ../Random.Youtube.Video.firefox.zip *
- name: Create Release notes
run: |
Expand All @@ -78,5 +83,7 @@ jobs:
with:
tag_name: v${{ needs.CheckVersion.outputs.newVersion }}
name: v${{ needs.CheckVersion.outputs.newVersion }}
files: Random.Youtube.Video.zip
files: |
Random.Youtube.Video.chromium.zip
Random.Youtube.Video.firefox.zip
body_path: RELEASE_NOTES.md
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Changelog

## v2.0.1 (Unreleased)
## v2.1.0

<!--Releasenotes start-->
- The extension is now available for Firefox as well.
- The extension's background service worker will no longer reload if an error was encountered when shuffling using the button in the popup.
- Fixed a bug where a fatal error would be encountered if the extension was choosing a non-embeddable video and shorts were ignored.
- Fixed a bug where the 'Shuffle' button could sometimes show a negative fetch percentage when updating a channel's videos.
- Fixed a bug where you were unable to shuffle when using the 'percentage' filtering option with a value of 100%.
- Fixed a bug where it was possible that the default user settings would not get initialized correctly when first installing the extension.
- Fixed a bug where new tabs opened by the extension would sometimes be opened in a new window instead.
- Fixed a number of bugs related to internal message passing that may have occurred when using the extension on Firefox.
- Fixed some cosmetic issues across the extension.
- Made the internal handling of user settings more robust.
- The extension is now bundled using Webpack, which makes it faster and easier to maintain.
Expand Down
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
<img src="https://img.shields.io/chrome-web-store/users/kijgnjhogkjodpakfmhgleobifempckf"
alt="Chrome web store users"></a>
<br>
<a href="https://github.com/NikkelM/Random-YouTube-Video/tree/main/CHANGELOG.md">
<img src="https://img.shields.io/badge/view-changelog-blue"
alt="View changelog"></a>
<img alt="GitHub Workflow Status - Tests" src="https://img.shields.io/github/actions/workflow/status/NikkelM/Random-YouTube-Video/test.yml?branch=main&label=tests">
<a href='https://coveralls.io/github/NikkelM/Random-YouTube-Video?branch=main'>
<img src='https://coveralls.io/repos/github/NikkelM/Random-YouTube-Video/badge.svg?branch=main'
alt='Coverage Status' /></a>
<br>
<a href="https://github.com/NikkelM/Random-YouTube-Video/tree/main/CHANGELOG.md">
<img src="https://img.shields.io/badge/view-changelog-blue"
alt="View changelog"></a>
</p>

You can download the extension on the [Chrome Web Store](https://chrome.google.com/webstore/detail/random-youtube-video/kijgnjhogkjodpakfmhgleobifempckf) or the [Microsoft Edge Add-ons Store](https://microsoftedge.microsoft.com/addons/detail/random-youtube-video/fccfflipicelkilpmgniblpoflkbhdbe). The Chrome Web Store version can be installed on any Chromium-based browser, including Edge, Brave and more.
Download the extension for [Chrome/Chromium](https://chrome.google.com/webstore/detail/random-youtube-video/kijgnjhogkjodpakfmhgleobifempckf) | [Edge](https://microsoftedge.microsoft.com/addons/detail/random-youtube-video/fccfflipicelkilpmgniblpoflkbhdbe).

The Chrome Web Store version can be installed on any Chromium-based browser, such as Edge, Brave, Opera...

---

Expand All @@ -36,9 +40,38 @@ Highlighted Features:<br>

Do you have ideas for new features or have encountered a bug? Please [open an issue](https://github.com/NikkelM/Random-YouTube-Video/issues/new/choose).

<!-- The `main` branch of this repository *should* always be stable. If you want to test the newest unreleased features, simply load the `extension` folder as an unpacked extension in your browser of choice.
The `main` branch of this repository *should* always be stable. If you want to test the newest unreleased features, follow the steps below to create a version of the extension you can add to your browser.
<br>
You can find out what new changes are coming with the unreleased version in the [changelog](https://github.com/NikkelM/Random-YouTube-Video/blob/main/CHANGELOG.md).
Did you find any bugs with the version you tested? Please let me know by [opening an issue](https://github.com/NikkelM/Random-YouTube-Video/issues/new/choose)! -->
You can find out what new changes are coming with the newest unreleased version in the [changelog](https://github.com/NikkelM/Random-YouTube-Video/blob/main/CHANGELOG.md).
Did you find any bugs with the version you tested? Please let me know by [opening an issue](https://github.com/NikkelM/Random-YouTube-Video/issues/new/choose)!

### Installation

- Install the required dependencies by running `npm install` in the root directory of the project.
- Use `npm run build` to build a distribution for each browser environment.
- `npm run build:chromium` builds a distribution for Chrome/Chromium only.
- `npm run build:firefox` builds a distribution for Firefox only.
- Replace `build` with `dev` in the above commands to build a development version of the extension that updates automatically when you make changes to the code.
- The bundled extension files will be placed in the `dist/<browser>` directories.
- You can load the extension in your browser by following the instructions below.

#### Chrome/Chromium

- Open the Extension Management page by navigating to `chrome://extensions`.
- Make sure that you have enabled developer mode.
- Click `Load unpacked` and choose the `dist/chromium` folder.

Loading the extension like this will persist it until you remove it manually.

#### Firefox

- Open the Add-ons page by navigating to `about:addons`.
- Click the cog icon and select `Debug Add-ons`.
- Click `Load Temporary Add-on...` and choose the `dist/firefox/manifest.json` file.

Loading the extension like this will persist it only *until you restart Firefox*.
You may also test the extension with Firefox by running `npm run dev:firefox`, which uses `web-ext` to load the extension in a temporary Firefox profile.

---

If you enjoy this extension and want to say thanks, consider buying me a [coffee](https://ko-fi.com/nikkelm), or [sponsoring](https://github.com/sponsors/NikkelM) this project.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
Loading

0 comments on commit c1fd5c9

Please sign in to comment.