Skip to content

Commit

Permalink
Do not run extension when jQuery is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaschampagne committed Apr 12, 2024
1 parent 2ccfc10 commit c600ef5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions webextension/extension.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface JQuery {
}

interface Window {
jQuery: any;
$: any;
fancybox: any;
currentAthlete: any;
Expand Down
7 changes: 6 additions & 1 deletion webextension/scripts/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { CoreMessages } from "@elevate/shared/models/core-messages";

class Boot {
public static main(): void {
window.$ = jQuery;
if (!window.jQuery) {
console.warn("Missing jQuery, elevate will not run");
return;
}

window.$ = window.jQuery;
window.fancybox = fancybox;
window.fancybox(window.$);

Expand Down

0 comments on commit c600ef5

Please sign in to comment.