You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -195,7 +197,7 @@ declare function GM_getResourceURL(
195
197
* - If `true`, returns a `blob:` URL. It's short and cacheable, so it's good for reusing in multiple DOM elements.
196
198
* - If `false`, returns a `data:` URL. It's long so reusing it in DOM may be less performant due to the lack of caching, but it's particularly handy for direct synchronous decoding of the data on sites that forbid fetching `blob:` in their CSP.
197
199
*/
198
-
isBlobUrl?: boolean,
200
+
isBlobUrl?: boolean|undefined,
199
201
): string;
200
202
201
203
/**
@@ -219,7 +221,7 @@ declare function GM_addElement(
219
221
/** A tag name like `script`. Any valid HTML tag can be used, but the only motivation for this API was to add `script`, `link`, `style` elements when they are disallowed by a strict `Content-Security-Policy` of the site e.g. github.com, twitter.com. */
220
222
tagName: string,
221
223
/** The keys are HTML attributes, not DOM properties, except `textContent` which sets DOM property `textContent`. The values are strings so if you want to assign a private function to `onload` you can do it after the element is created. */
222
-
attributes?: Record<string,string>,
224
+
attributes?: Record<string,string>|undefined,
223
225
): HTMLElement;
224
226
declarefunctionGM_addElement(
225
227
/**
@@ -235,15 +237,15 @@ declare function GM_addElement(
235
237
/** A tag name like `script`. Any valid HTML tag can be used, but the only motivation for this API was to add `script`, `link`, `style` elements when they are disallowed by a strict `Content-Security-Policy` of the site e.g. github.com, twitter.com. */
236
238
tagName: string,
237
239
/** The keys are HTML attributes, not DOM properties, except `textContent` which sets DOM property `textContent`. The values are strings so if you want to assign a private function to `onload` you can do it after the element is created. */
238
-
attributes?: Record<string,string>,
240
+
attributes?: Record<string,string>|undefined,
239
241
): HTMLElement;
240
242
241
243
/** Appends and returns a `<style>` element with the specified CSS. */
/** Make the new tab active (i.e. open in foreground). Default as `true`. */
255
-
active?: boolean;
257
+
active?: boolean|undefined;
256
258
/**
257
259
* Firefox only.
258
260
*
259
261
* - not specified = reuse script's tab container
260
262
* - `0` = default (main) container
261
263
* - `1`, `2`, etc. = internal container index
262
264
*/
263
-
container?: number;
265
+
container?: number|undefined;
264
266
/** Insert the new tab next to the current tab and set its `openerTab` so when it's closed the original tab will be focused automatically. When `false` or not specified, the usual browser behavior is to open the tab at the end of the tab list. Default as `true`. */
265
-
insert?: boolean;
267
+
insert?: boolean|undefined;
266
268
/** Pin the tab (i.e. show without a title at the beginning of the tab list). Default as `false`. */
267
-
pinned?: boolean;
269
+
pinned?: boolean|undefined;
268
270
}
269
271
270
272
/** Opens URL in a new tab. */
271
273
declarefunctionGM_openInTab(
272
274
/** The URL to open in a new tab. URL relative to current page is also allowed. Note: Firefox does not support data URLs. */
273
275
url: string,
274
-
options?: VMScriptGMTabOptions,
276
+
options?: VMScriptGMTabOptions|undefined,
275
277
): VMScriptGMTabControl;
276
278
declarefunctionGM_openInTab(
277
279
/** The URL to open in a new tab. URL relative to current page is also allowed. Note: Firefox does not support data URLs. */
278
280
url: string,
279
281
/** Open the tab in background. Note, this is a reverse of the first usage method so for example `true` is the same as `{ active: false }`. */
280
-
openInBackground?: boolean,
282
+
openInBackground?: boolean|undefined,
281
283
): VMScriptGMTabControl;
282
284
283
285
/**
@@ -291,16 +293,18 @@ declare function GM_registerMenuCommand(
291
293
/** Callback function when the command is clicked in the menu. */
292
294
onClick: (event: MouseEvent|KeyboardEvent)=>void,
293
295
/** @since VM2.15.9 */
294
-
options?: {
295
-
/** Default: the `caption` parameter.
296
-
* In 2.15.9-2.16.1 the default was a randomly generated string. */
297
-
id?: string;
298
-
/** A hint shown in the status bar when hovering the command. */
299
-
title?: string;
300
-
/** Default: `true`.
301
-
* Whether to auto-close the popup after the user invoked the command. */
302
-
autoClose?: boolean;
303
-
},
296
+
options?:
297
+
|{
298
+
/** Default: the `caption` parameter.
299
+
* In 2.15.9-2.16.1 the default was a randomly generated string. */
300
+
id?: string|undefined;
301
+
/** A hint shown in the status bar when hovering the command. */
302
+
title?: string|undefined;
303
+
/** Default: `true`.
304
+
* Whether to auto-close the popup after the user invoked the command. */
305
+
autoClose?: boolean|undefined;
306
+
}
307
+
|undefined,
304
308
): string;
305
309
/** Unregisters a command which has been registered to Violentmonkey popup menu. */
0 commit comments