single-file-core 1.5.62 → 1.5.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16947,6 +16947,14 @@ async function evalTemplate(template = "", options, content, doc, context = {})
16947
16947
  "tab-id": { getter: () => String(options.tabId) },
16948
16948
  "tab-index": { getter: () => String(options.tabIndex) },
16949
16949
  "url-last-segment": { getter: () => decode(getLastSegment(url, options.filenameReplacementCharacter)) },
16950
+ "url-filename": {
16951
+ getter: () => {
16952
+ const pathname = url.pathname;
16953
+ const segments = pathname.split("/");
16954
+ const lastSegment = segments[segments.length - 1] || segments[segments.length - 2] || "";
16955
+ return decode(lastSegment);
16956
+ }, dontReplaceSlash: dontReplaceSlashIfUndefined
16957
+ },
16950
16958
  "bookmark-pathname": { getter: () => bookmarkFolder, dontReplaceSlash: dontReplaceSlashIfUndefined },
16951
16959
  "bookmark-pathname-flat": { getter: () => bookmarkFolder, dontReplaceSlash: false },
16952
16960
  "profile-name": { getter: () => options.profileName },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.62",
3
+ "version": "1.5.64",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",
@@ -336,12 +336,15 @@
336
336
  }
337
337
 
338
338
  if (globalThis.FontFace) {
339
- const FontFace = globalThis.FontFace;
340
- globalThis.FontFace = function () {
341
- getDetailObject(...arguments).then(detail => document.dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
342
- return new FontFace(...arguments);
339
+ const origFontFace = globalThis.FontFace;
340
+ globalThis.FontFace = function FontFace(family, source, ...args) {
341
+ if (!new.target) {
342
+ return origFontFace();
343
+ }
344
+ getDetailObject(family, source, ...args).then(detail => document.dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
345
+ return new FontFace(family, source, ...args);
343
346
  };
344
- globalThis.FontFace.prototype = FontFace.prototype;
347
+ globalThis.FontFace.prototype = origFontFace.prototype;
345
348
  globalThis.FontFace.toString = function () { return "function FontFace() { [native code] }"; };
346
349
  const deleteFont = document.fonts.delete;
347
350
  document.fonts.delete = function (fontFace) {