1
1
// ==UserScript==
2
- // @name #Example
2
+ // @name Userscript Name
3
3
// @namespace https://github.com/#REPLACE:User/Repo#readme
4
4
// @version 1.0.0
5
5
// @description #REPLACE:Userscript Description
8
8
// @license WTFPL
9
9
// @author #REPLACE:Author name
10
10
// @copyright #REPLACE:Author name (#REPLACE:Author URL)
11
- // @icon https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/assets/images/logo_48.png?b=3f6dd30
11
+ // @icon https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/assets/images/logo_48.png?b=aab91c6
12
12
// @match #REPLACE:Match URL(s) - i.e. *://*.example.com/*
13
13
// @run -at document-start
14
- // @downloadURL https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/dist/#Example .user.js
15
- // @updateURL https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/dist/#Example .user.js
14
+ // @downloadURL https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/dist/Userscript Name .user.js
15
+ // @updateURL https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/dist/Userscript Name .user.js
16
16
// @connect github.com
17
17
// @connect raw.githubusercontent.com
18
18
// @grant GM.getValue
22
22
// @grant GM.xmlHttpRequest
23
23
// @grant GM.openInTab
24
24
// @noframes
25
- // @resource img-icon https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/assets/images/icon.png?b=3f6dd30
26
- // @resource doc-changelog https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/CHANGELOG.md?b=3f6dd30
25
+ // @resource img-icon https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/assets/images/icon.png?b=aab91c6
26
+ // @resource doc-changelog https://raw.githubusercontent.com/#REPLACE:User/Repo/develop/CHANGELOG.md?b=aab91c6
27
27
// @require https://cdn.jsdelivr.net/npm/@sv443-network/[email protected] /dist/index.global.js
28
28
// @grant GM.registerMenuCommand
29
29
// @grant GM.listValues
@@ -59,7 +59,10 @@ function __awaiter(thisArg, _arguments, P, generator) {
59
59
typeof SuppressedError === "function" ? SuppressedError : function ( error , suppressed , message ) {
60
60
var e = new Error ( message ) ;
61
61
return e . name = "SuppressedError" , e . error = error , e . suppressed = suppressed , e ;
62
- } ; /** Default compression format used throughout the entire script */
62
+ } ; const buildNumberRaw = "aab91c6" ;
63
+ /** The build number of the userscript */
64
+ const buildNumber = ( buildNumberRaw . match ( / ^ # { { .+ } } $ / ) ? "BUILD_ERROR!" : buildNumberRaw ) ; // asserted as generic string instead of literal
65
+ /** Default compression format used throughout the entire script */
63
66
const compressionFormat = "deflate-raw" ;
64
67
/** Whether sessionStorage is available and working */
65
68
typeof ( sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage . setItem ) !== "undefined"
@@ -75,11 +78,11 @@ typeof (sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionS
75
78
}
76
79
} ) ( ) ;
77
80
/** Info about the userscript, parsed from the userscript header (tools/post-build.js) */
78
- ( {
81
+ const scriptInfo = {
79
82
name : GM . info . script . name ,
80
83
version : GM . info . script . version ,
81
84
namespace : GM . info . script . namespace ,
82
- } ) ; let canCompress ;
85
+ } ; let canCompress ;
83
86
const config = new userutils . DataStore ( {
84
87
id : "script-config" ,
85
88
defaultData : {
@@ -173,6 +176,7 @@ function init() {
173
176
function run ( ) {
174
177
return __awaiter ( this , void 0 , void 0 , function * ( ) {
175
178
try {
179
+ console . log ( `Initializing ${ scriptInfo . name } v${ scriptInfo . version } (#${ buildNumber } )...` ) ;
176
180
// post-build these double quotes are replaced by backticks (because if backticks are used here, the bundler converts them to double quotes)
177
181
addStyle ( "#{{GLOBAL_STYLE}}" , "global" ) ;
178
182
initObservers ( ) ;
@@ -183,4 +187,4 @@ function run() {
183
187
}
184
188
} ) ;
185
189
}
186
- init ( ) ; } ) ( UserUtils ) ; //# sourceMappingURL=http://localhost:8710/#Example .user.js.map
190
+ init ( ) ; } ) ( UserUtils ) ; //# sourceMappingURL=http://localhost:8710/Userscript Name .user.js.map
0 commit comments