single-file-core 1.0.26 → 1.0.28

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.
@@ -142,11 +142,17 @@
142
142
  let singleFileComment = result && result.singleNodeValue;
143
143
  if (singleFileComment && isSingleFileComment(singleFileComment)) {
144
144
  const info = singleFileComment.textContent.split("\n");
145
- const [, , url, saveDate, ...infoData] = info;
145
+ const [, , urlData, saveDate, ...infoData] = info;
146
+ const urlMatch = urlData.match(/^ url: (.*) $/);
147
+ const url = urlMatch && urlMatch[1];
146
148
  if (url && saveDate) {
147
149
  let options;
148
150
  if (browser && browser.runtime && browser.runtime.sendMessage) {
149
- options = await browser.runtime.sendMessage({ method: "tabs.getOptions", url });
151
+ try {
152
+ options = await browser.runtime.sendMessage({ method: "tabs.getOptions", url });
153
+ } catch (error) {
154
+ options = { displayInfobar: true };
155
+ }
150
156
  } else {
151
157
  options = { displayInfobar: true };
152
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",