|
Rank: Advanced Member Groups: Member
Joined: 1/5/2015 Posts: 60
|
Hi.
We recently changed to EO2016, but we're having some difficulties with setting ZoomFactor on WebViews.
We used to be able to set the ZoomFactor on the WebView before it was rendered. But now the ZoomFactor is forced reset to 1.0 when the WebView is rendered.
The only workaround we've came up with is to sleep a little before setting the zoom factor, but this is far from optimal as we don't know when it is safe to set the zoom factor and it can produce jumpy UI.
I'm not sure if this is a bug or a feature by design.
What we essential would like, is to be able to set a default zoom factor, i.e. 1.25 (125%), on a webview before it is shown. Like we used to be able to.
Hope you can help or provide a better workaround.
Thanks.
Jeppe Haugaard Sørensen
|
|
Rank: Advanced Member Groups: Member
Joined: 10/7/2015 Posts: 35
|
Hi, I am not support... But I have no problem setting the zoomFactor to, say, 2 and then rendering the URL - on the near latest version of 2016. I wonder if this is related to a recently fixed issue here - http://www.essentialobjects.com/ChangeLog.aspx - *Fixed WebView.ZoomFactor contains the wrong value when a new WebView inherits a preset zoom factor for a specific website issue* So I wonder if you are using or relying on multiple web views inheriting the same zoom value?
|
|
Rank: Advanced Member Groups: Member
Joined: 1/5/2015 Posts: 60
|
Thanks for the answer.
We've just start using EO.Total 2016.1.68 (the latest).
You say "...the near latest version..", which version is that?
I could be that that the fix in 2016.1.68 broke/changed the zoom factor behavior then.
We do not rely on zoom factor inheritance, but rather manually set ZoomFactor on all WebViews, that we create and those created by new window events.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
This is what we are trying to tell you ---- you can not expect a WebView to stay at a certain zoom factor. The zoom factor is set per website, not per WebView. So if you navigate from one Url to another Url in the same WebView, the zoom factor can change. The best we can do is to make sure when this occurs, your code will be notified. This is what is fixed in the new build.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 1/5/2015 Posts: 60
|
Ok, understood. Just a different behavior than we've been used to for the EO WebBrowser.
We wanted to set a default zoom factor/level for all pages, like you're able to in Google Chrome.
We got the desired behavior using a workaround.
Thanks.
|
|
Rank: Advanced Member Groups: Member
Joined: 10/7/2015 Posts: 35
|
Jeppe,
I think you've missed the point again. The point is that Chrome is the cause of this behavior. You are wrong to claim that Chrome does something different. The whole reason this is a problem (for me anyway) is because the behavior comes from the Chromium code - it reuses zoom factors across URL's of the same domain. The way to avoid it, in EO, is to use separate Engines.
|
|
Rank: Advanced Member Groups: Member
Joined: 1/5/2015 Posts: 60
|
Panda,
I'm not claiming that Google Chrome does something different. I know Chrome operates with different zoom factors for the different pages, which is the same as the EO WebBrowser does now apparently. (Didn't before).
I'm just saying that you have the option i Chrome to set a DEFAULT zoom factor (default is the keyword here), that applies to all urls, tabs whatever.
You can try it yourself in Chrome by changing "settings" -> "Web content" -> "Page zoom".
This is the only functionality we were after.
We made it work another way, so it doesn't really matter. But thanks for the input.
|
|
Rank: Advanced Member Groups: Member
Joined: 10/7/2015 Posts: 35
|
Hi Jeppe, I tried that setting, it still doesn't work the way you seem to suggest it does. I set default zoom to 120% in settings I open a page at www.bla.com - 120% I set it to 150% I open a new tab at www.bla.com - what's the zoom? it's 150%. The default does not override the "zoom memory between same domain" feature. EO Web browser always did this. I'm pretty sure that EO has no control over this feature within the Chromium library without going to a great deal of technical difficulty.
|
|
Rank: Advanced Member Groups: Member
Joined: 1/5/2015 Posts: 60
|
Panda,
We don't disagree. I'm not trying to suggest that the default zoom level in Chrome overrides "zoom memory between same domain".
What I am saying, is that you have the option in Chrome to set a default zoom level/factor, that will be used when opening new windows/tabs. (On new domains). Call it a "base" zoom level if you want.
That way, whenever opening a new page with no "zoom memory" it will start at zoom level, let's say 125% instead of the 100%. "zoom memory between same domain" will still overrule this.
Said in another way, we want the zoom factor to default to something other than 100% (providing that there is no "zoom memory between same domain").
We used to achieve this "base" zoom level by setting the zoom factor on WebViews as we created them. This was pre EO2016. We achieved the same in the latest version with css.
|
|
Rank: Advanced Member Groups: Member
Joined: 10/7/2015 Posts: 35
|
Yeah thanks, the ZoomFactor still doesn't work how I would expect it - after downloading the latest version.
If I open a WebView at bla.com and set the zoom to 60%. Then I dispose that webview, open another one at bla.com, set the zoom to 100% - THE ZOOM IS STILL SHOWING AS 60%. Even after explicitly setting it to 100%! I tried setting it to 99% and then 100% - still doesn't work. Still shows 60%. It seems to be "timing". You have to wait some unknown amount of time, then set the zoomFactor to 100% and then it will work.
I don't know how to code around this other than to reset the engine every time.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Can you try to set it in LoadCompleted event handler and see if it works for you?
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 4/6/2015 Posts: 33
|
We use EO.WebBrowser to load a local on-disk HTML file plus CSS plus JavaScript which then runs a small form layout application.
The application can be used to layout multiple forms simultaneously. But if the user sets the ZoomFactor in one form, they all change. I suppose this is because they are all pointed at the same "url", the path to the local on-disk HTML file.
Is there any way to get around this?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, There is no clean way to do this. You can try to use fake Urls that points to different "domains" and then use custom resource handler to load your resources: https://www.essentialobjects.com/doc/webbrowser/advanced/resource_handler.aspxThis way the browser engine will treat them as from different domain thus not applying the same zoom level. Thanks!
|
|