wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.34k stars 1.22k forks source link

Triggering the go function in curretn view nesting iframe page, no response #2253

Closed JoiLa closed 1 year ago

JoiLa commented 1 year ago

Description

I have a page, in the parent page view, I inject one iframe page. Triggering the go function in this iframe page view , no response. so I think in iframe view call go function should has response.

image

To Reproduce

  1. git clone git@github.com:JoiLa/wails-v2.2.0-vue-project-example.git
  2. cd frontend && npm i;
  3. cd the project root && npm run quick-build-windows-app

Expected behaviour

iframe views in the current page can effectively trigger the go function

Screenshots

No response

Attempted Fixes

in iframe page view, the code window.parent.window.go... can receive go function response

System Details

Wails CLI v2.2.0

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Windows 10 Enterprise
Version:        2009 (Build: 19045)
ID:             22H2
Go Version:     go1.19.4
Platform:       windows
Architecture:   amd64

Wails
------
Version:        v2.2.0

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
WebView2        N/A             Installed       108.0.1462.54
npm             N/A             Installed       6.14.13
*upx            N/A             Installed       upx 3.96
*nsis           N/A             Available

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - nsis : Available at https://nsis.sourceforge.io/Download

Additional context

No response

leaanthony commented 1 year ago

Duplicate of https://github.com/wailsapp/wails/issues/2047 ?

JoiLa commented 1 year ago

Duplicate of #2047 ?

:) I think this problem Not the same , you can try my provided reproduce .

leaanthony commented 1 year ago

I think it is the same problem because the iframe is a different page so it won't have the bindings injected.

JoiLa commented 1 year ago

image

vue use history router, so load view already run wails script

<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script>
stffabi commented 1 year ago

Yes this is currently not possible.

Another thing that would need to be discussed how Events should work. One would need to specify the frame into which the Event should be sent.