Skip to content

Commit bdb7baa

Browse files
s
1 parent 3baaa86 commit bdb7baa

File tree

3 files changed

+2108
-196
lines changed

3 files changed

+2108
-196
lines changed

app/scripts/content/utils.js

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ export function $helperbird_i18n(params, replace = null) {
44
: chrome.i18n.getMessage(params, replace);
55
}
66

7-
8-
97
export function getBrowser() {
108
if (isFirefox()) {
119
return 'firefox';
@@ -25,8 +23,6 @@ export function isFirefox(agent) {
2523
return /firefox/i.test(userAgent);
2624
}
2725

28-
29-
3026
export function isEdge(agent) {
3127
let userAgent = isEmpty(agent) ? navigator.userAgent : agent;
3228
return /Edg/i.test(userAgent);
@@ -46,8 +42,6 @@ export function isChrome(agent, vendor) {
4642
return /Chrome/.test(userAgent) && /Google Inc/.test(vendorAgent);
4743
}
4844

49-
50-
5145
export function isEmpty(value) {
5246
return (
5347
value === undefined ||
@@ -70,54 +64,26 @@ export function removeElementById(id) {
7064
}
7165
}
7266

67+
export function injectCssInline(id, style) {
68+
let head = document.head || document.getElementsByTagName('head')[0];
69+
let sheet = document.createElement('style');
70+
71+
sheet.setAttribute('id', id);
7372

73+
sheet.type = 'text/css';
7474

75-
export function injectCssInline(id, style) {
76-
let head = document.head || document.getElementsByTagName("head")[0];
77-
let sheet = document.createElement("style");
78-
79-
sheet.setAttribute("id", id);
80-
81-
sheet.type = "text/css";
82-
8375
sheet.appendChild(document.createTextNode(style));
8476
head.appendChild(sheet);
85-
}
86-
77+
}
8778

88-
export function idExists(id) {
79+
export function idExists(id) {
8980
return document.getElementById(id) !== null;
9081
}
9182

92-
93-
94-
9583
export function isNull(value) {
9684
return value === null;
9785
}
9886

99-
100-
101-
102-
103-
104-
105-
106-
107-
108-
109-
110-
111-
112-
113-
114-
115-
116-
117-
118-
119-
120-
12187
export default {
12288
isSafari: isSafari,
12389
isEdge: isEdge,

0 commit comments

Comments
 (0)