pinokiod 1.0.19 → 1.0.21

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.19",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -401,6 +401,9 @@ body.dark #new-tab {
401
401
  </main>
402
402
  </div>
403
403
  <script>
404
+ window.prompt = (a, b) => {
405
+ console.log("global overridden prompt", { a, b })
406
+ }
404
407
  let loaded = {}
405
408
  let cursorIndex = 0;
406
409
  const getTarget = (href) => {
@@ -578,11 +581,12 @@ console.log({ type, index })
578
581
  "allow",
579
582
  "clipboard-read *; clipboard-write *; accelerometer *; ambient-light-sensor *; autoplay *; battery *; camera *; display-capture *; gamepad *; geolocation *; gyroscope *; hid *; identity-credentials-get *; microphone *; midi *; otp-credentials *; serial *;"
580
583
  )
581
- frame.contentWindow.prompt = function(a, b) {
582
- console.log("prompt1", { a, b })
583
- return prompt(a, b)
584
- }
585
584
  document.querySelector("main").appendChild(frame)
585
+ frame.onload = () => {
586
+ frame.contentWindow.prompt = (a, b) => {
587
+ console.log("1 overridden prompt", { a, b })
588
+ }
589
+ }
586
590
  loaded[target.target] = true
587
591
  }
588
592
  } else {
@@ -688,9 +692,10 @@ const addTab = async (url) => {
688
692
  "clipboard-read *; clipboard-write *; accelerometer *; ambient-light-sensor *; autoplay *; battery *; camera *; display-capture *; gamepad *; geolocation *; gyroscope *; hid *; identity-credentials-get *; microphone *; midi *; otp-credentials *; serial *;"
689
693
  )
690
694
  document.querySelector("main").appendChild(frame)
691
- frame.contentWindow.prompt = function(a, b) {
692
- console.log("prompt", { a, b })
693
- return prompt(a, b)
695
+ frame.onload = () => {
696
+ frame.contentWindow.prompt = (a, b) => {
697
+ console.log("2 overridden prompt", { a, b })
698
+ }
694
699
  }
695
700
 
696
701
  await syncTabs()