Closed dongjian closed 3 years ago
It’s a limitation of webviews in general. If you search: webview not loading uri, you’ll find many examples of this limitation. Same for alert.
OK , thanks , i'll try change my web code to make it work
After doing some research . I found that because I'm in the js code use the "window. RequestIdleCallback". The webview may not support this Experimental feature. Delete it later I can use the code blow to commune with the web .
wv.eval(
r#"
MapComponent参数.mapType = 'Google'
"#,
);
That’s good to know 👍
also found it impossible to load SVG , png works fine My code
export const Car = (p: {
rotation: number
}) =>
<img
src='./car.svg' ///<- if change to a png works fine . bug svg just show a [X]
width='20'
height='20'
style={{
transform: `translate(-50%, -50%) rotate(${p.rotation}deg)`
}}
/>
My SVG
<?xml version="1.0" encoding="UTF-8"?>
<svg width="27px" height="42px" viewBox="0 0 27 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
<title>Group 6</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group-6" transform="translate(1.000000, 1.000000)" stroke="#000000">
<path d="M4.05882353,14.6478873 L4.05882353,27.0109546" id="Line" stroke-width="1.04347826" stroke-linecap="round"></path>
<path d="M20.8235294,14.6478873 L20.8235294,27.0109546" id="Line-Copy" stroke-width="1.04347826" stroke-linecap="round"></path>
<path d="M17.8114654,15.1524334 C15.9252903,14.7237766 14.0462026,14.5229748 12.1742021,14.550028 C10.2579113,14.5777213 8.3487077,14.8332695 6.44659148,15.3166727 L5.61639549,9.43928034 C7.50348621,7.65978584 9.68942176,6.78810569 12.1742021,6.82423989 C14.9145207,6.8616201 17.1004562,7.81676399 18.7320088,9.68967158 L17.8114654,15.1524334 Z" id="Line-2" stroke-width="1.043" stroke-linecap="square"></path>
<path d="M17.635664,36.7665735 C15.4487183,36.4798567 13.5757273,36.3477635 12.016691,36.3702939 C10.4207687,36.3933574 8.60028144,36.5254506 6.55522913,36.7665735 L6.55522913,31.3688684 C8.12683295,30.2221426 9.94732023,29.6638262 12.016691,29.6939195 C14.2988786,29.7250504 16.1118125,30.2833667 17.4554927,31.3688684 L17.635664,36.7665735 Z" id="Line-2-Copy" stroke-width="1.043" stroke-linecap="square" transform="translate(12.095447, 33.229669) rotate(180.000000) translate(-12.095447, -33.229669) "></path>
<path d="M2.74514254,14.4600939 C2.76679118,14.9037045 2.81899109,15.5064452 2.90174226,16.2683159 L7.38964445e-13,16.768262 C5.85295128e-13,15.5762277 0.915047512,14.8068383 2.74514254,14.4600939 Z" id="Path-14" stroke-width="0.7" stroke-linecap="round"></path>
<path d="M24.8305618,14.3974961 C24.8522105,14.8411067 24.9044104,15.4438474 24.9871615,16.2057181 L22.0854193,16.7056642 C22.0854193,15.5136298 23.0004668,14.7442405 24.8305618,14.3974961 Z" id="Path-14-Copy" stroke-width="0.7" stroke-linecap="round" transform="translate(23.536290, 15.551580) scale(-1, 1) translate(-23.536290, -15.551580) "></path>
<path d="M3.30996248,13.1241368 C3.84159173,13.0981665 4.27097051,11.971569 4.27097051,10.1344422 C4.27097051,8.35068834 3.83483131,7.27417922 3.3441173,7.28236116 C2.83383259,7.29086941 2.39986804,8.35490364 2.39986804,10.1344422 C2.39986804,11.9839082 2.83487848,13.1473448 3.30996248,13.1241368 Z" id="Oval-4" stroke-width="1.04347826"></path>
<path d="M3.81684608,34.3053302 C4.34847534,34.2793599 4.77785411,33.1527624 4.77785411,31.3156356 C4.77785411,29.5318818 4.34171491,28.4553727 3.85100091,28.4635546 C3.3407162,28.4720628 2.90675165,29.5360971 2.90675165,31.3156356 C2.90675165,33.1651016 3.34176208,34.3285383 3.81684608,34.3053302 Z" id="Oval-4-Copy-2" stroke-width="1.04347826"></path>
<path d="M21.1776095,13.1241368 C21.7092388,13.0981665 22.1386176,11.971569 22.1386176,10.1344422 C22.1386176,8.35068834 21.7024784,7.27417922 21.2117644,7.28236116 C20.7014796,7.29086941 20.2675151,8.35490364 20.2675151,10.1344422 C20.2675151,11.9839082 20.7025255,13.1473448 21.1776095,13.1241368 Z" id="Oval-4-Copy" stroke-width="1.04347826"></path>
<path d="M21.1776095,34.3053302 C21.7092388,34.2793599 22.1386176,33.1527624 22.1386176,31.3156356 C22.1386176,29.5318818 21.7024784,28.4553727 21.2117644,28.4635546 C20.7014796,28.4720628 20.2675151,29.5360971 20.2675151,31.3156356 C20.2675151,33.1651016 20.7025255,34.3285383 21.1776095,34.3053302 Z" id="Oval-4-Copy-3" stroke-width="1.04347826"></path>
<path d="M3.92980918,40.000015 C4.53247391,37.2628446 7.23680397,35.8531856 12.0427994,35.771038 C16.740143,35.7659355 19.5881907,37.0592975 20.5869426,39.6511237" id="Path-17-Copy" stroke-width="1.04347826" stroke-linecap="round" transform="translate(12.258376, 37.885519) scale(1, -1) translate(-12.258376, -37.885519) "></path>
<path d="M3.08197747,5.58867087 C3.72748231,1.86612797 6.69717659,0.00323767865 11.9910603,0 C17.3349866,0.0714039399 20.4142431,1.93429423 21.2288298,5.58867087" id="Path-17" stroke-width="1.04347826" stroke-linecap="round"></path>
</g>
</g>
</svg>
I think svgs should work. Can you try with a simpler svg?
My bad . After remove target/debug , then cargo run , both png and svg works fine . thanks!
Hi! Sorry to bother you again
i try wv.navigate("http://blog.csdn.net"); The page will appear for a second and then go blank. (wv.navigate("http://google.com"); works fine)
Js alert() is also unresponsive
and i have a
also it's not working.
I tested all the above on the browser without any problems
any help ?