pinokiod 1.0.40 → 1.0.42
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 +1 -1
- package/server/views/browser.ejs +25 -20
package/package.json
CHANGED
package/server/views/browser.ejs
CHANGED
|
@@ -440,10 +440,10 @@ body.dark .loader-container {
|
|
|
440
440
|
<div class='container'>
|
|
441
441
|
<nav>
|
|
442
442
|
<div class='hidden bar'>
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
443
|
+
<% if (agent === "electron") { %>
|
|
444
|
+
<button class='btn2 logo' id='back'><i class="fa-solid fa-arrow-left"></i></button>
|
|
445
|
+
<button class='btn2 logo' id='forward'><i class="fa-solid fa-arrow-right"></i></button>
|
|
446
|
+
<% } %>
|
|
447
447
|
<button class='btn2' id='clone-tab'><i class='fa-regular fa-copy'></i> Clone</button>
|
|
448
448
|
<a class='btn2' id='open-browser' target="_blank" href=""><i class="fa-solid fa-square-arrow-up-right"></i> Popout</a>
|
|
449
449
|
<button class='btn2' id='reload'><i class="fa-solid fa-rotate-right"></i> Refresh</button>
|
|
@@ -529,15 +529,15 @@ const renderCursor = () => {
|
|
|
529
529
|
const nav = (type) => {
|
|
530
530
|
let targetFrame = document.querySelector("iframe:not(.hidden)")
|
|
531
531
|
if (type === "back") {
|
|
532
|
-
targetFrame.contentWindow.history.back()
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
532
|
+
// targetFrame.contentWindow.history.back()
|
|
533
|
+
targetFrame.contentWindow.postMessage({
|
|
534
|
+
action: "back"
|
|
535
|
+
}, "*")
|
|
536
536
|
} else if (type === "forward") {
|
|
537
|
-
targetFrame.contentWindow.history.forward()
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
537
|
+
// targetFrame.contentWindow.history.forward()
|
|
538
|
+
targetFrame.contentWindow.postMessage({
|
|
539
|
+
action: "forward"
|
|
540
|
+
}, "*")
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
|
|
@@ -867,14 +867,14 @@ document.querySelector("#reload").addEventListener("click", (e) => {
|
|
|
867
867
|
frame.src = frame.src
|
|
868
868
|
// frame.contentWindow.location.reload();
|
|
869
869
|
})
|
|
870
|
-
|
|
871
|
-
document.querySelector("#back").addEventListener("click", (e) => {
|
|
872
|
-
|
|
873
|
-
})
|
|
874
|
-
document.querySelector("#forward").addEventListener("click", (e) => {
|
|
875
|
-
|
|
876
|
-
})
|
|
877
|
-
|
|
870
|
+
<% if (agent === "electron") { %>
|
|
871
|
+
document.querySelector("#back").addEventListener("click", (e) => {
|
|
872
|
+
nav("back")
|
|
873
|
+
})
|
|
874
|
+
document.querySelector("#forward").addEventListener("click", (e) => {
|
|
875
|
+
nav("forward")
|
|
876
|
+
})
|
|
877
|
+
<% } %>
|
|
878
878
|
|
|
879
879
|
document.querySelector("#new-tab").addEventListener("click", async (e) => {
|
|
880
880
|
const u = prompt("url")
|
|
@@ -1155,6 +1155,11 @@ window.addEventListener('message', (event) => {
|
|
|
1155
1155
|
addTab(event.data.action.url)
|
|
1156
1156
|
} else if (event.data.action.type === "title") {
|
|
1157
1157
|
console.log("title", event.data)
|
|
1158
|
+
} else if (event.data.action.type === "location") {
|
|
1159
|
+
let url = event.data.action.url
|
|
1160
|
+
console.log({ action: event.data.action })
|
|
1161
|
+
document.querySelector("#open-browser").href = url
|
|
1162
|
+
document.querySelector("#location").innerHTML = url
|
|
1158
1163
|
}
|
|
1159
1164
|
} else if (event.data.type) {
|
|
1160
1165
|
if (event.data.type === 'disconnect') {
|