Skip to content

Commit d9a97cb

Browse files
committed
Obtain jQuery through imports.
No more nonsense :)
1 parent f2aea61 commit d9a97cb

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/gmail.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ interface GmailCache {
991991
////////////////////////////////////////////////////////////////////////////////
992992

993993
declare class Gmail {
994-
constructor(localJQuery?: JQueryStatic);
994+
constructor();
995995

996996
version: string;
997997
/**

src/gmail.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,10 @@
66

77
/*eslint-env es6*/
88

9-
var Gmail = function(localJQuery) {
9+
import $ from "jquery";
1010

11-
/*
12-
Use the provided "jQuery" if possible, in order to avoid conflicts with
13-
other extensions that use $ for other purposes.
14-
*/
15-
var $;
16-
if (typeof localJQuery !== "undefined") {
17-
$ = localJQuery;
18-
} else if (typeof jQuery !== "undefined") {
19-
$ = jQuery;
20-
} else {
21-
// try load jQuery through node.
22-
try {
23-
$ = require("jquery");
24-
}
25-
catch(err) {
26-
// else leave $ undefined, which may be fine for some purposes.
27-
}
28-
}
29-
30-
var window_opener = typeof (window) !== "undefined" ? window.opener : null;
11+
const Gmail = function() {
12+
let window_opener = typeof (window) !== "undefined" ? window.opener : null;
3113
if (window_opener) {
3214
try {
3315
// access to window.opener domain will fail in case of cross-origin access

0 commit comments

Comments
 (0)