forked from jae-jae/Userscript-Plus
-
-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathheader.js
More file actions
48 lines (48 loc) · 1.39 KB
/
Copy pathheader.js
File metadata and controls
48 lines (48 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[[metadata]]
(() => {
'use strict';
/******************************************************************************/
/**
* Uncompressed locales + compiler
*
* [_locales](https://github.com/magicoflolis/Userscript-Plus/tree/master/src/_locales)
*
* [languageLoader.js](https://github.com/magicoflolis/Userscript-Plus/blob/master/tools/languageLoader.js)
*/
const translations = [[languageList]];
/**
* To compile this CSS `pnpm run build:Sass`
*
* [Uncompiled Cascading Style Sheet](https://github.com/magicoflolis/Userscript-Plus/tree/master/src/sass)
*/
const main_css = `[[mainCSS]]`;
const inIframe = () => {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
if (inIframe()) {
return;
}
let userjs = self.userjs;
/**
* Skip text/plain documents, based on uBlock Origin `vapi.js` file
*
* [Source Code](https://github.com/gorhill/uBlock/blob/master/platform/common/vapi.js)
*/
if (
(document instanceof Document ||
(document instanceof XMLDocument && document.createElement('div') instanceof HTMLDivElement)) &&
/^image\/|^text\/plain/.test(document.contentType || '') === false &&
(self.userjs instanceof Object === false || userjs.UserJS !== true)
) {
userjs = self.userjs = { UserJS: true };
}
if (!(typeof userjs === 'object' && userjs.UserJS)) {
return;
}
/******************************************************************************/
[[code]]
})();