0

I wonder how can I save the scroll position of large html in webcontrol in windows phone lets say a bookmarking ?

Anyone knows?

ali haider
  • 333
  • 3
  • 13

1 Answers1

0

One technique I have used:

WebBrowser.ScriptInvoke( "exec", "window.external.notify(
[window.outerWidth 
, window.outerHeight
, window.pageXOffset
, window.pageYOffset
, document.body.style.zoom
].join('|')");

and catch the resulting string in WebBrowser.ScriptNotify event handler.

This runs a javascript on any page the user has currently loaded, you don't need to modify the page itself. You must wait till the WebBrowser.LoadCompleted event to make sure the page is stable.

If you know user didn't zoom the web page, you wouldn't need the zoom, outerWidth and outerHeight.

BobHy
  • 1,575
  • 10
  • 23
  • Thank you but I found this method easier ,Just add these procedures to every Html page: And execute it using InvokeScript – ali haider Dec 16 '13 at 15:52
  • That sounds fine if you have control of the web pages the user loads. – BobHy Dec 17 '13 at 16:29