From e599c8dc664f4ce641046d9d3e9e39c136629e4b Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Mon, 16 Dec 2024 12:28:31 +0700 Subject: [PATCH] Add mock extension APIs for Jest testing and update Jest configuration --- .github/README.md | 228 ++++++++++++---------- .github/workflows/eslint_csslint_jest.yml | 38 +++- jest.config.js | 11 +- mock-extension-apis.js | 14 ++ 4 files changed, 170 insertions(+), 121 deletions(-) create mode 100644 mock-extension-apis.js diff --git a/.github/README.md b/.github/README.md index e46bf4795..1ce7ed877 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,17 +1,20 @@ - + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> -/ImprovedTube/ a powerful but lightweight extension,
to enrich your video experience & enable your content selection. +/ImprovedTube/ a powerful but lightweight extension,
to enrich your video experience & enable your content selection. + +![Test Coverage](./coverage.svg) +![CI Status](https://github.com/code-charity/youtube/actions/workflows/eslint_csslint_jest.yml/badge.svg)
Top 50recommended by firefox g 'Might
be the only YouTube Extension you'll ever need'
'enhances YouTube in meaningful ways'
'Strong Add-on, full control. Yet clear & easy'
@@ -19,74 +22,75 @@
translators (+ wiki-authors? +donators?):bowtie:

-
+
Original introduction

«Improve YouTube!»   

- -/ImprovedTube/ is a strong & lightweight extension! - 80 features / the only one of a kind!

+ +/ImprovedTube/ is a strong & lightweight extension! - 80 features / the only one of a kind!

Since 2012 we have gradually been adding lightweight features, while keeping up with Youtube changes. -(throughout the years we witnessed the birth & fall of other promising & open YouTube Extensions [1](https://github.com/YePpHa/YouTubeCenter "YouTubeCenter"), [2](https://github.com/ParticleCore/Iridium "Iridium"), ... ) +(throughout the years we witnessed the birth & fall of other promising & open YouTube Extensions [1](https://github.com/YePpHa/YouTubeCenter "YouTubeCenter"), [2](https://github.com/ParticleCore/Iridium "Iridium"), ... ) Today adding features can be easier & so motivating as there are 500 000 users. [[👪Join us]](https://github.com/code-for-charity/YouTube-Extension/discussions/1006 "github.com/Code-for-Charity").

Improve Youtube 2Improve Youtube 3Improve Youtube -

+

#####
Spread the word [📣](Http://Twitter_Whatsapp_Discord_Youtube_Facebook_eMail_Telegram_Signal)
-        - -**W**hy arent there millions of users yet? We didn't write a guide or manual, let alone ads. This project can "fly much higher" through your word of mouth & eventually enable us to work on all wishes & immediate fixes around the clock🌱
+ +        - +**W**hy arent there millions of users yet? We didn't write a guide or manual, let alone ads. This project can "fly much higher" through your word of mouth & eventually enable us to work on all wishes & immediate fixes around the clock🌱

Contributing

For more info on how to contribute, see the contribution wiki or #development

Please join us! And let's re-define "extensions"! (Why are they often unfunded & neglected?) -

🏷️Roadmap

- - - [ ] _Find [developers](https://github.com/code-charity/youtube/discussions/1881), patreons_ - - - [ ] _All [bugs](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+), many [wishes](https://github.com/code4charity/YouTube-Extension/issues?q=label%3A%22Feature+Request%22+sort%3Acomments-desc+is%3Aopen+-label%3A_++-label%3A%22not+Goo.+Chrome%22+)_ - - [ ] _Documentation, tooltips_ - - - [ ] _Tags for our search (multilanguage)_ - - [ ] Continuously integrate awesome code: [YCS](https://github.com/sonigy/YCS)
[Userscripts](https://greasyfork.org/en/scripts?sort=total_installs#:~:text=HTML5%20Video), [Nova](https://github.com/raingart/Nova-YouTube-extension)?, [yr](https://github.com/MarcGuiselin/youtube-refined)filters or more([i](https://github.com/ThomasTavernier/Improve-Crunchyroll) [p](https://github.com/ppixiv/ppixiv) [r](https://github.com/refined-github/refined-github) [o](https://github.com/ovity/octotree),..) - - - [ ] Smart Player-[buttons](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1445) for all \ - - [ ] Clean YT's DOM? (+avoid CPU-rendering) - - [ ] Smart [filtering /discovery](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1451), [YT.js](https://github.com/LuanRT/YouTube.js), [M](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1463), [D](https://github.com/code-charity/youtube/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22%3Cmeta%3E+data%22) - - - [ ] Integrate data [#1452](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1452), [SB](https://github.com/mchangrh/sb-mirror) / [NB](https://github.com/andrewzlee/NeuralBlock) etc. - - [ ] Full-page GUI: History & Dashboard - - [ ] Consider m.youtube.com (grey-out some) - - [ ] Ask Samsung Browser to list us - -

Translators          🌎

+

🏷️Roadmap

+ +- [ ] _Find [developers](https://github.com/code-charity/youtube/discussions/1881), patreons_ +- - [ ] _All [bugs](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+), many [wishes](https://github.com/code4charity/YouTube-Extension/issues?q=label%3A%22Feature+Request%22+sort%3Acomments-desc+is%3Aopen+-label%3A_++-label%3A%22not+Goo.+Chrome%22+)_ +- [ ] _Documentation, tooltips_ +- - [ ] _Tags for our search (multilanguage)_ +- [ ] Continuously integrate awesome code: [YCS](https://github.com/sonigy/YCS)
[Userscripts](https://greasyfork.org/en/scripts?sort=total_installs#:~:text=HTML5%20Video), [Nova](https://github.com/raingart/Nova-YouTube-extension)?, [yr](https://github.com/MarcGuiselin/youtube-refined)filters or more([i](https://github.com/ThomasTavernier/Improve-Crunchyroll) [p](https://github.com/ppixiv/ppixiv) [r](https://github.com/refined-github/refined-github) [o](https://github.com/ovity/octotree),..) +- - [ ] Smart Player-[buttons](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1445) for all \ +- [ ] Clean YT's DOM? (+avoid CPU-rendering) +- [ ] Smart [filtering /discovery](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1451), [YT.js](https://github.com/LuanRT/YouTube.js), [M](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1463), [D](https://github.com/code-charity/youtube/issues?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22%3Cmeta%3E+data%22) +- - [ ] Integrate data [#1452](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues/1452), [SB](https://github.com/mchangrh/sb-mirror) / [NB](https://github.com/andrewzlee/NeuralBlock) etc. +- [ ] Full-page GUI: History & Dashboard +- [ ] Consider m.youtube.com (grey-out some) + - [ ] Ask Samsung Browser to list us + +

Translators          🌎

✔️EN en_GB : Korbough
Proofreaders:___ (You?)
CN(zh_CN) : -niceRAM +niceRAM ausers
CN(zh_TW) : -Still34 +Still34 water903
suitangi
ES : -Kioraga -Compvictor +Kioraga +Compvictor dimateos
DMCS20
HI : -monishamandal02 +monishamandal02 BRAVO68WEB
FR : -leghort -Eymiks +leghort +Eymiks Solvabl
AR : Raayib
BN : BRAVO68WEB
RU : -qweered +qweered alexesprit
pt_BR : -dthiago +dthiago Mike-Correa
DavidBrazSan unnamed-orbert :)
@@ -94,25 +98,25 @@ For more info on how to contribute, see the DrNopt unnamed-orbert
ID : -Bagus23 +Bagus23 A.Muttaqin
DE : -Termuellinator +Termuellinator css-smueller
JA : utuhiro78
TR : -onurdumangoz +onurdumangoz decimaldreamer
VN : zeref-dragneel
KO : -msc9533 +msc9533 LYHyoung
(Iranian) Persian : AC Lover
IT : -urfausto +urfausto FedericoSlongo
TH Thai : ______(You?)
@@ -127,7 +131,7 @@ For more info on how to contribute, see the SE : KiloBravoBFE
NL : -aron-hoogeveen +aron-hoogeveen Vistaus
RO : hateofhades
@@ -154,19 +158,19 @@ For more info on how to contribute, see the Croatian : (You?)
NO : -master3395 +master3395 comradekingu
SK : bbc-s
Catalan, Valencian : (You?)
Estonian : -(You?)
+(You?)
[Help us Translate]
(=here), or on ​Crowdin
- - ...Many popular languages are
spoken more / written less, but
please add yours!
(even if just a few words for fun.) - +- ...Many popular languages are
spoken more / written less, but
please add yours!
(even if just a few words for fun.) + Urdu Nigerian Pidgin (English Creole)
Western-&Eastern-Punjabi
@@ -176,73 +180,77 @@ For more info on how to contribute, see the [Help us Translate]
(=here), or on ​Crowdin

##### 💡 Vision for Open-Source Efficiency: 🌱 [`Auto Contributors`](https://github.com/code4charity/Open-Source-Bot--Github-Git-Pull-Request-Bot) -(Compare: Wikipedia Bots. Would especially help medium-size projects.) (+[list of regEx](https://github.com/code4charity/the-RegEx-Collector--Queries--Patterns " - ")?) -##### 💡 Vision for the _(tweaking-/userStyle-/"modding-"_)Community: + +(Compare: Wikipedia Bots. Would especially help medium-size projects.) (+[list of regEx](https://github.com/code4charity/the-RegEx-Collector--Queries--Patterns " - ")?) + +##### 💡 Vision for the _(tweaking-/userStyle-/"modding-"_)Community + We can optimize the www's GUI, greatly prioritized: [Crowd Fixes](https://github.com/code-charity/Universal-UserTweaks)
( "insteada just tweakin@home like Sisyphos" )
-##### 💡 Got great ideas? - Notify us? - [github/**Wish-Factory**](https://github.com/code-for-charity/wish-factory "💡") (or ideas@improvedtube.com) + +##### 💡 Got great ideas? - Notify us? - [github/**Wish-Factory**](https://github.com/code-for-charity/wish-factory "💡") (or )

🎁Our Extensions:

- + **Superb:** [**History Manager**](https://chrome.google.com/webstore/detail/unblob-alpha/odognhgojidbcgconbcipmgffjcmfaoj)
**Global / Filters:** [unFreeze me](https://chrome.google.com/webstore/detail/ctrl-f-freedom-%20-right-cl/ijngdimmjkngoglcjaheoadciaalbafl " - Unlock your Right-Click, Ctrl+F, Selection anywhere!")[](https://github.com/code-for-charity/unlock-keyboard-and-mouse) [Dark Mode](https://chrome.google.com/webstore/detail/dark-mode/declgfomkjdohhjbcfemjklfebflhefl " - Universal dark-mode!") [](https://github.com/code-for-charity/dark-mode)
Research: [Ultimate Regex](https://chrome.google.com/webstore/detail/regex-search/pmihaiejckejbpjdnildimfkpcpnohlo)("Ctrl+F+Shift")[](https://github.com/code-for-charity/regex) ([`Regex Replace`](https://chrome.google.com/webstore/detail/regex-replace/ihcaaefaoebbcklmolaflgllidfamfgm))
**Browser:** [`Custom user agent`](https://chrome.google.com/webstore/detail/custom-user-agent/ncgbkkljbaojkhljombpjejedphfhdjj)[](https://github.com/code-for-charity/user-agent) [`auto-scroll`](https://chrome.google.com/webstore/detail/auto-scroll/kpfalbhnppkbokafignonoppegdndlch "(missing in Linux)")
**Video / Media:** (integrate them in this extension please)
[Looper](https://chrome.google.com/webstore/detail/looper/hlnfnoahfgnjnbkdckfnolacbmoknlmi)[](https://github.com/code-for-charity/looper) [Frame by Frame](https://chrome.google.com/webstore/detail/frame-by-frame/cclnaabdfgnehogonpeddbgejclcjneh)[](https://github.com/code-for-charity/frame-by-frame) [`unBlob`](https://chrome.google.com/webstore/detail/unblob-alpha/odognhgojidbcgconbcipmgffjcmfaoj)[](https://github.com/code-for-charity/unblob "please fix/adopt me!") (Equalizer[](https://github.com/code-for-charity/equalizer))
Home: (Start Page tabs ), [`TextEditor`](https://chrome.google.com/webstore/detail/text-editor/bnbgafdjiinlgnjaedmfaablklnafpka) [](https://github.com/code-for-charity/Editor), [`ToDo`](https://chrome.google.com/webstore/detail/to-do/mniboiicchcpkffcdlaocnkfpbdihgii)[](https://github.com/code-for-charity/todo)
**Development:** [**`Satus`**](https://github.com/code-for-charity/satus) (Our JS library) | [`WebGL.js`](https://github.com/code-for-charity/webgl.js) - WebGL Library
[endless grid](https://github.com/code-for-charity/pluviam), [CodeEditor](https://github.com/code-for-charity/code-editor), [TE](https://github.com/code-for-charity/theme-engine), [Viscum Player](https://github.com/code-for-charity/viscum-player) - video.js?
-
👩‍💻

"Behind the scenes"

-web store +web store web store analytics -

youtube recommmendation

Do you need to run a popular extension, site, app or repo?
We'd love to help meaningful projects@improvedtube.com -
+

youtube recommmendation

Do you need to run a popular extension, site, app or repo?
We'd love to help meaningful projects@improvedtube.com +
🏝🏕 To-Do / Maintenance:

🏷️ Labels

(sorted/Filtered = Dynamic To-Do lists)
- -**0.** [ ] [**Bugs🐞**](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+ "we aim to offer some bug-bounties. Please ask") (we try to offer some bug bounty. [Please ask](mailto:bugs@improvedtube.com?subject=TODO_BOUNTY_LINK "especially if you are at a cheap/poor place ❤️") .) +**0.** [ ] [**Bugs🐞**](https://github.com/code4charity/YouTube-Extension/issues?q=label%3Abug+sort%3Acomments-desc+is%3Aopen+-label%3A_+ "we aim to offer some bug-bounties. Please ask") (we try to offer some bug bounty. [Please ask](mailto:bugs@improvedtube.com?subject=TODO_BOUNTY_LINK "especially if you are at a cheap/poor place ❤️") .)
**1.** **[ ]** [**Documentation, wiki, screenshots, video, ...**](https://github.com/code-for-charity/YouTube-Extension/wiki "We need to help people learning as easily as possible about our 90+ features. (Drafts welcome. This will become 🛈tooltips in the extension too!") -> We need to help people to learn as easily as possible about our [90+ features](https://github.com/ImprovedTube/ImprovedTube/wiki/Features). (Drafts welcome. This can become **🛈ToolTips** in the extension!")
+**[ ]**[Updating translations](https://github.com/code-for-charity/YouTube-Extension/wiki/Translation-HowTo " - some language files miss additions.") +**[ ]**proofreading [eng](https://github.com/ImprovedTube/ImprovedTube/blob/master/_locales/en/messages.json) +> We need to help people to learn as easily as possible about our [90+ features](https://github.com/ImprovedTube/ImprovedTube/wiki/Features). (Drafts welcome. This can become **🛈ToolTips** in the extension!")
+**[ ]**[Updating translations](https://github.com/code-for-charity/YouTube-Extension/wiki/Translation-HowTo " - some language files miss additions.") +**[ ]**proofreading [eng](https://github.com/ImprovedTube/ImprovedTube/blob/master/_locales/en/messages.json) **2.** [ ][**Plans / Specifications 🧩**](https://github.com/code-for-charity/ImprovedTube-for-YouTube/issues?q=is%3Aissue+sort%3Acomments-desc+is%3Aopen+label%3A%22%F0%9F%A7%A9Plan+ready%22++-label%3A%22not+Goo.+Chrome%22+ "often unique & relevant (special)")
   **&**    [ ] [**organizational Discussions**](https://github.com/code-for-charity/YouTube-Extension/discussions?discussions_q=category%3AToDo++category%3AOrganization+ "Future & Structure") -
**3.** [ ] [**Feature Requests🌟🧚**](https://github.com/code4charity/YouTube-Extension/issues?q=label%3A%22Feature+Request%22+sort%3Acomments-desc+is%3Aopen+-label%3A_++-label%3A%22not+Goo.+Chrome%22+ "- sometimes easy / CSS") - sometimes easy / CSS
     **+** [ ]  [**Wishes in discussions**](https://github.com/code-for-charity/YouTube-Extension/discussions?discussions_q=-category%3AToDo+-category%3AOrganization+ "Wishes, Ideas, Questions, News") - +
**3.** [ ] [**Feature Requests🌟🧚**](https://github.com/code4charity/YouTube-Extension/issues?q=label%3A%22Feature+Request%22+sort%3Acomments-desc+is%3Aopen+-label%3A_++-label%3A%22not+Goo.+Chrome%22+ "- sometimes easy / CSS") - sometimes easy / CSS
     **+** [ ]  [**Wishes in discussions**](https://github.com/code-for-charity/YouTube-Extension/discussions?discussions_q=-category%3AToDo+-category%3AOrganization+ "Wishes, Ideas, Questions, News") +
**0.1. [ ]** Tidy: [(Rest/Unsorted 'issues')](https://github.com/code4charity/YouTube-Extension/issues?q=is%3Aissue+is%3Aopen+-label%3Abug+-label%3A%22Feature+Request%22+-label%3A%F0%9F%A7%A9Plan%20ready+-label%3A_+-label%3A%22not+Goo.+Chrome%22+sort%3Acreated-desc++-label%3A"Niche%2Frare+usecase%3F%2Ffun%3F"++-label%3Aunclear "Our github issues, which are not yet labled yet to appear in one of the ToDo-categories above") -> Further reading: [***"Contributing without programming"***](https://github.com/ImprovedTube/YouTube-Extension/discussions/753) & [*"Our CSS, JavaScript, json"*](https://github.com/ImprovedTube/ImprovedTube/pull/371#issuecomment-669725163) ( ***outdated**)* (*Newcomers are [we](https://github.com/ImprovedTube/ImprovedTube/issues/387#issuecomment-664980078)lcome tho! We review all edits & love to collaborate*) -

+> Further reading: [_**"Contributing without programming"**_](https://github.com/ImprovedTube/YouTube-Extension/discussions/753) & [_"Our CSS, JavaScript, json"_](https://github.com/ImprovedTube/ImprovedTube/pull/371#issuecomment-669725163) ( _**outdated**)_ (_Newcomers are [we](https://github.com/ImprovedTube/ImprovedTube/issues/387#issuecomment-664980078)lcome tho! We review all edits & love to collaborate_) +
Features 🧰⋮⚙️🎛️☕🎧🎞️🎬🔊📈🎨⏯️

https://www.youtube.com/watch?v=SLfff7Kw_Xc


-https://github.com/code-charity/youtube/wiki/Manual +https://github.com/code-charity/youtube/wiki/Manual
- - - Fit Video to window, default resolution or pop-up player - - Hiding distractions - - Youtube Themes, Colors & night schedule - - Video Repeat-, screenshot-, rotate-buttons - - Customizable hotkeys / shortcuts - -
+ +- Fit Video to window, default resolution or pop-up player +- Hiding distractions +- Youtube Themes, Colors & night schedule +- Video Repeat-, screenshot-, rotate-buttons +- Customizable hotkeys / shortcuts + + +
📟 "ImprovedTube Ticker 2022" /Pinned Issues ###### ❔[**ImprovedTube controls** in, under or around the video player or cursor](https://github.com/code4charity/YouTube-Extension/issues/1445).
❔[**Meaningful/Most similar extensions**? Social-Fixer, Youtube Enhancer, Simplify, ...](https://github.com/code4charity/YouTube-Extension/issues/1016).
📟 We are focused on updates, bugs & UX but please keep up your wishes for Features!
📟 Enjoy **our projects: global** [**Dark Mode**](https://chrome.google.com/webstore/detail/dark-mode/declgfomkjdohhjbcfemjklfebflhefl), to tweak CSS everywhere + Theme engine in the making, ...
📟 **2021:** Firefox, Edge, Opera, Whale added (please try&rate)
-
📜Historic Introduction +
📜Historic Introduction [ImprovedTube](https://chrome.google.com/webstore/detail/improve-youtube-open-sour/bnomihfieiccainjcjblhegjgglakjdd),       is an extension we built to refine your YouTube experience. A powerful one-stop-shop with many features to enhance YouTube, yet liteweight. Be it a larger player or more tidy / studious YouTube UI, hiding distractions. And there was so much left to build and are many clever features to come still.        ImprovedTube is designed with our own UI library: [Satus](https://github.com/code-for-charity/satus) (to manage your settings efficiently & create familiar apps/['cousins](https://chrome.google.com/webstore/detail/dark-mode/declgfomkjdohhjbcfemjklfebflhefl) easily.)       Please spread the word: ImprovedTube is the only project of it's kind, because other open Youtube Extensions resigned. No other project provides so much CSS to adjust a website[🦄](https://github.com/search?q=stars%3A%3E700++size%3A%3E3000+++language%3ACSS++App+OR+Addon+OR+Extension+NOT+framework+NOT+apps&type=Repositories&s=updated&o=desc). @@ -251,6 +259,7 @@ https://github.com/code-charity/youtube/wiki/Manual chrome-web-store-linkChrome-users

**Some ImprovedTube features**: + - Video quality - Themes and customisation - Repeat-, screenshot-, rotate-buttons @@ -266,57 +275,60 @@ _[Full list](https://github.com/ImprovedTube/YouTube/wiki/Features)_ **🔧 Install from source** 1.) **Download & extract the [[latest🧪version]](https://github.com/code4charity/YouTube-Extension/archive/refs/heads/master.zip) or [[release]](https://github.com/code-for-charity/YouTube-Extension/releases)** -- **Safari**: + +- **Safari**: - 2.) [Issue #494](https://github.com/code4charity/YouTube-Extension/issues/494#issuecomment-675098753) - **Chrome / Chromium / Brave / Edge / Vivaldi** - - 2.) Go to your Browser's Extensions page (*chrome://extensions/*) + - 2.) Go to your Browser's Extensions page (_chrome://extensions/_) - 3.) Activate `Developer mode` - 4.) Click the `Load unpacked` button & Select the extracted folder - **Firefox / LibreWolf / Waterfox / IceCat** - - 2.) Go to `Add-ons` (*about:addons*) - - 3.) Click on `Extensions` tab - - 4.) Click on `Debug Add-ons` (*about:debugging#/runtime/this-firefox*) - - 5.) Click on `Load Temporary Add-on…` - - 6.) Select the `manifest.json` file from unzipped folder + - 2.) Go to `Add-ons` (_about:addons_) + - 3.) Click on `Extensions` tab + - 4.) Click on `Debug Add-ons` (_about:debugging#/runtime/this-firefox_) + - 5.) Click on `Load Temporary Add-on…` + - 6.) Select the `manifest.json` file from unzipped folder + +#### Web browser support -#### Web browser support |[Brave](https://brave.com)
Brave | [Chromium](https://github.com/chromium/chromium)
Chromium | [Chrome](https://chrome.google.com/webstore/detail/improve-youtube-open-sour/bnomihfieiccainjcjblhegjgglakjdd)
Chrome | [Edge](https://www.microsoft.com/edge)
Edge | [Firefox](https://foundation.mozilla.org)
Firefox | [Opera](https://addons.opera.com/en/extensions/details/install-chrome-extensions/)
Opera| [Safari](https://www.apple.com/safari/)
Safari | [Vivaldi](https://github.com/ric2b/Vivaldi-browser)
Vivaldi | | --------- | --------- | --------- | --------- | --------- | --------- | --------- | --------- | -| 0.52+ | 49.0+ | 49.0+ | 79.0+ | 44.0+ | 36.0+ | x.x+ | 1.0+ | +| 0.52+ | 49.0+ | 49.0+ | 79.0+ | 44.0+ | 36.0+ | x.x+ | 1.0+ | +
🔧 Installing from source 1.) **Download & extract the [[latest🧪version]](https://github.com/code4charity/YouTube-Extension/archive/refs/heads/master.zip) or [[release]](https://github.com/code-for-charity/YouTube-Extension/releases)** -- **Safari**: + +- **Safari**: - 2.) [**Build yourself**](https://github.com/code4charity/YouTube-Extension/issues/494#issuecomment-675098753) - - OR + - OR - 2.) Right-click ImprovedTube.app and select the "Open" option from the drop down menu. - - 3.) Run this extension in your Applications folder - - 4.) Open System Settings, click Privacy & Security, scroll down, and click the Open Anyway button (Allow App Store and identified developers first) - - 5.) Click Quit and Open Safari Settings... - - 6.)Click Advanced in Safari Settings and then turn on Show Develop menu in menu bar - - 7.) Click Develop in Safari menu bar and then turn on Allow Unsigned Extensions - - If you’re using Safari 17 or later, click the Developer tab in Safari Settings, and select the “Allow unsigned extensions” option - - The Allow Unsigned Extensions setting resets when a user quits Safari, so you need to set it again the next time you launch Safari. - - 8.) Click Develop in Safari menu bar and then turn on Allow Unsigned Extensions - - 9.) You will see this extension in Extensions of Safari Settings, turn on it - - 10.) Click Always Allow on Every Website + - 3.) Run this extension in your Applications folder + - 4.) Open System Settings, click Privacy & Security, scroll down, and click the Open Anyway button (Allow App Store and identified developers first) + - 5.) Click Quit and Open Safari Settings... + - 6.)Click Advanced in Safari Settings and then turn on Show Develop menu in menu bar + - 7.) Click Develop in Safari menu bar and then turn on Allow Unsigned Extensions + - If you’re using Safari 17 or later, click the Developer tab in Safari Settings, and select the “Allow unsigned extensions” option + - The Allow Unsigned Extensions setting resets when a user quits Safari, so you need to set it again the next time you launch Safari. + - 8.) Click Develop in Safari menu bar and then turn on Allow Unsigned Extensions + - 9.) You will see this extension in Extensions of Safari Settings, turn on it + - 10.) Click Always Allow on Every Website - **Chrome / Chromium / Brave / Edge / Vivaldi** - - 2.) Go to your Browser's Extensions page (*chrome://extensions/*) + - 2.) Go to your Browser's Extensions page (_chrome://extensions/_) - 3.) Activate `Developer mode` - 4.) Click the `Load unpacked` button & Select the extracted folder - **Firefox / LibreWolf / Waterfox / IceCat** - - 2.) Go to `Add-ons` (*about:addons*) - - 3.) Click on `Extensions` tab - - 4.) Click on `Debug Add-ons` (*about:debugging#/runtime/this-firefox*) - - 5.) Click on `Load Temporary Add-on…` - - 6.) Select the `manifest.json` file from unzipped folder -
- + - 2.) Go to `Add-ons` (_about:addons_) + - 3.) Click on `Extensions` tab + - 4.) Click on `Debug Add-ons` (_about:debugging#/runtime/this-firefox_) + - 5.) Click on `Load Temporary Add-on…` + - 6.) Select the `manifest.json` file from unzipped folder +
diff --git a/.github/workflows/eslint_csslint_jest.yml b/.github/workflows/eslint_csslint_jest.yml index a05095b41..a74a54b6f 100644 --- a/.github/workflows/eslint_csslint_jest.yml +++ b/.github/workflows/eslint_csslint_jest.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: npm install --force - + - name: Run eslint run: npx eslint --config=tests/eslint_rules.config.mjs continue-on-error: true @@ -35,16 +35,40 @@ jobs: # continue-on-error: true - name: Run Jest - run: npx jest # --config=tests/jest.config.js + run: npx jest --coverage # --config=tests/jest.config.js + + - name: Coverage Badge + uses: ImBIOS/lcov-coverage-badge@v1 + with: + file: ./coverage/lcov.info + + - name: Verify Changed files + uses: tj-actions/verify-changed-files@v20 + id: verify-changed-files + with: + files: 'coverage.svg' + + - name: Commit files + if: steps.verify-changed-files.outputs.files_changed == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add coverage.svg + git commit -m "Updated coverage.svg" - - name: Run npm test - run: npm test + - name: Push changes + if: steps.verify-changed-files.outputs.files_changed == 'true' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.github_token }} + branch: ${{ github.ref }} - - name: Install csslint using npm - run: npm install -g csslint@1.0.5 + # - name: Run npm test + # run: npm test + # - name: Install csslint using npm + # run: npm install -g csslint@1.0.5 # - name: Lint CSS files # run: | # for file in $(grep -rl --include='*.css' '' ./); do npx csslint --config tests/csslint_rules.json "$file"; done - diff --git a/jest.config.js b/jest.config.js index 5e9923b5e..342c09722 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,8 +1,7 @@ +/** @type {import('jest').Config} */ module.exports = { - testPathIgnorePatterns: [ - "/node_modules/" - ], - testMatch: [ - "**/tests/**/*.js" - ] + testPathIgnorePatterns: ['/node_modules/'], + testMatch: ['**/tests/**/*.js'], + coverageReporters: ['lcov', 'text'], + setupFiles: ['/mock-extension-apis.js'], }; diff --git a/mock-extension-apis.js b/mock-extension-apis.js new file mode 100644 index 000000000..b371757bf --- /dev/null +++ b/mock-extension-apis.js @@ -0,0 +1,14 @@ +global.chrome = { + tabs: { + query: jest.fn((options, callback) => callback([])), + }, + storage: { + local: { + get: jest.fn((callback) => callback({})), + set: jest.fn(), + }, + onChanged: { + addListener: jest.fn(), + }, + }, +};