gree / gree/unity-webview

Adding javascript in local html

Open
#333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

Description

Hi,

I'm loading an html file in webview and i have to add text, Why i can't reference by id an element and add text?

For example, i have:
var urlLocal = UniWebViewHelper.StreamingAssetURLForPath("local_www/game.html");
webView.Load(urlLocal);

I have to do for example an document.getElementById for add text, or modify attributes and don't work. Instead if I do an alert if it works. Im adding the javascript to webview with EvaluateJavaScript.

Thanks,

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue's local_www/game.html example and the calls to UniWebViewHelper.StreamingAssetURLForPath, Load, and EvaluateJavaScript. Reproduce the difference between alert and document.getElementById, then determine the relevant webview behavior and verify that DOM text or attribute changes work in the local page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.