pinokiod 1.0.26 → 1.0.27

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -615,20 +615,23 @@ document.querySelector("#forward").addEventListener("click", (e) => {
615
615
  document.querySelector("#new-tab").addEventListener("click", async (e) => {
616
616
  const u = prompt("url")
617
617
 
618
- let o = {}
619
- if (/^[0-9.:]/.test(u)) {
620
- o.forceHttp = true
621
- } else if (/^localhost/.test(u)) {
622
- o.forceHttp = true
623
- } else {
624
- o.forceHttps = true
625
- }
626
- const url = normalizeURL(u, o)
618
+ if (u) {
619
+ let o = {}
620
+ if (/^[0-9.:]/.test(u)) {
621
+ o.forceHttp = true
622
+ } else if (/^localhost/.test(u)) {
623
+ o.forceHttp = true
624
+ } else {
625
+ o.forceHttps = true
626
+ }
627
627
 
628
- if (url && url.trim().length > 0) {
629
- console.log("url", url)
630
- const { tab, frame } = await addTab(url)
631
- tab.click()
628
+ const url = normalizeURL(u, o)
629
+
630
+ if (url && url.trim().length > 0) {
631
+ console.log("url", url)
632
+ const { tab, frame } = await addTab(url)
633
+ tab.click()
634
+ }
632
635
  }
633
636
  })
634
637
  document.querySelector("#clone-tab").addEventListener("click", async (e) => {