O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Injecting Web Page Behavior

On occasion you may want to invoke some JavaScript on a third-party web page, in which case relying on a named JavaScript function becomes impossible. Fortunately, JavaScript’s eval function gives us the power to execute arbitrary JavaScript.

Note

Be aware that it is possible to override the JavaScript eval function, which may result in less than complete reliability for the technique presented in this section. Overriding eval is, however, rare, and web pages that do this do not comply with the ECMAScript 5 specification.

To demonstrate the execution of arbitrary JavaScript, another button has been added to the WebBrowserWithScriptingView.xaml page. Clicking the button causes a script to be invoked on the web page, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required