Skip to content

Conversation

richerfu
Copy link
Contributor

@richerfu richerfu requested a review from a team as a code owner August 20, 2025 01:16
@lucasfernog
Copy link
Member

lucasfernog commented Aug 20, 2025

this is working really well!

see the cargo-mobile2 integration and the tauri branch

can we call https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/apis-arkweb/js-apis-webview.md#setwebdebuggingaccess when webview_attributes.devtools is true? I'm trying to debug a localhost usage, currently only remote URLs are working on tauri

@richerfu
Copy link
Contributor Author

richerfu commented Aug 20, 2025

this is working really well!

see the cargo-mobile2 integration and the tauri branch

can we call https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/apis-arkweb/js-apis-webview.md#setwebdebuggingaccess when webview_attributes.devtools is true? I'm trying to debug a localhost usage, currently only remote URLs are working on tauri

Could you try those changes in your local code which is in root/oh_modules/.ohpm/@ohos-rs+abilityxxx/xx ? @lucasfernog

If it works, i will publish a new version for @ohos-rs/ability

@lucasfernog
Copy link
Member

this is working really well!
see the cargo-mobile2 integration and the tauri branch
can we call https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/apis-arkweb/js-apis-webview.md#setwebdebuggingaccess when webview_attributes.devtools is true? I'm trying to debug a localhost usage, currently only remote URLs are working on tauri

Could you try those changes in your local code which is in root/oh_modules/.ohpm/@ohos-rs+abilityxxx/xx ? @lucasfernog

If it works, i will publish a new version for @ohos-rs/ability

harmony-contrib/openharmony-ability#28 (comment)

@lucasfernog
Copy link
Member

are the javaScriptOnDocumentStart scripts executed out of order? i'm seeing some weird behavior, is it running in reverse order?
for now i think i'll just combine all scripts into one.. but would be good to know exactly how the webview runs them

@richerfu
Copy link
Contributor Author

javaScriptOnDocumentStart

I need to check it. May i tell you later..

@lucasfernog
Copy link
Member

also can't we really register the custom protocols at runtime? currently we need to provide the names beforehand on the derive macro right?

@richerfu
Copy link
Contributor Author

also can't we really register the custom protocols at runtime? currently we need to provide the names beforehand on the derive macro right?

yeah,we need to register the custom protocols in a very early stage. When we need to register them at runtime, i can try to find some ways to support it

@lucasfernog
Copy link
Member

is the custom protocol triggered on fetch() calls? tauri uses that for the IPC

for instance this is what i get:

await fetch('tauri://localhost')
VM174:1 Fetch API cannot load tauri://localhost/. URL scheme "tauri" is not supported.

even though the page loaded is tauri://localhost

@lucasfernog
Copy link
Member

also can't we really register the custom protocols at runtime? currently we need to provide the names beforehand on the derive macro right?

yeah,we need to register the custom protocols in a very early stage. When we need to register them at runtime, i can try to find some ways to support it

cool that's fine, thanks

lucasfernog added a commit to lucasfernog/openharmony-ability that referenced this pull request Aug 20, 2025
this lets the custom protocol to return its response on a separate thread or async task, rather than relying on the return value of the callback

needed by tauri-apps/wry#1607
richerfu pushed a commit to harmony-contrib/openharmony-ability that referenced this pull request Aug 21, 2025
this lets the custom protocol to return its response on a separate thread or async task, rather than relying on the return value of the callback

needed by tauri-apps/wry#1607
@richerfu
Copy link
Contributor Author

is the custom protocol triggered on fetch() calls? tauri uses that for the IPC

for instance this is what i get:

await fetch('tauri://localhost')
VM174:1 Fetch API cannot load tauri://localhost/. URL scheme "tauri" is not supported.

even though the page loaded is tauri://localhost

Fixed.

@lucasfernog
Copy link
Member

you rock!!

@richerfu
Copy link
Contributor Author

are the javaScriptOnDocumentStart scripts executed out of order? i'm seeing some weird behavior, is it running in reverse order? for now i think i'll just combine all scripts into one.. but would be good to know exactly how the webview runs them

It run with lexicographic order.If we want to run them with array order, we need to use runJavaScriptOnDocumentStart , but it depends on api15 or newer. It's too new for us.

@richerfu
Copy link
Contributor Author

also can't we really register the custom protocols at runtime? currently we need to provide the names beforehand on the derive macro right?

In what scenarios will we register at runtime? From the documentation, it is clear that the protocol can only be registered before the web is initialized. There is no any other method to register :(

Copy link
Contributor

Package Changes Through 3d710b6

There are 1 changes which include wry with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
wry 0.53.2 0.53.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@richerfu richerfu requested a review from lucasfernog August 27, 2025 02:54
@richerfu
Copy link
Contributor Author

richerfu commented Sep 2, 2025

tauri-apps/tauri#7287

@richerfu
Copy link
Contributor Author

Hi @lucasfernog dear friend, if we want to continue this work, what we should do. Hope your reply thanks :)

@FabianLars
Copy link
Member

Just so you're not surprised, Lucas is on vacation (or at least out of office) for another week or so.
I think work on this from our side will slow down though because our task at our workplace, which made us look into it in the first place, is done.

@richerfu
Copy link
Contributor Author

Copy that, hope you have a good time. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants