ScriptSpot

Forum topic · General Scripting

System.Windows.forms.WebBrowser (For error see screenshots)

By 3dwannab · 2015-01-18

Description

See code below for opening a radio station from maxscript.

Problems have been attached as images. And the website I'm trying to open is: http://www.bbc.co.uk/radio/player/bbc_radio_one

I'm sure it's something to do with .ObjectForScripting but I'm not sure how to implement that.


rollout webbrowser_rollout "Radio" width:380 height:685
(
edittext edt_url "URL:" text:"http://www.bbc.co.uk/radio/player/bbc_radio_one"
dotNetControl wb "System.Windows.forms.WebBrowser" pos:[0,22] width:380 height:685
	
fn openURL urlString = (
wb.url = dotNetObject "System.Uri" urlString )
on edt_url entered txt do openURL txt
on webbrowser_rollout open do
(
--wb.ScriptErrorsSuppressed = true;
--wb.ObjectForScripting = true
openURL edt_url.text
wb.ScrollBarsEnabled = false;
wb.AllowNavigation = true;
)
)
createdialog webbrowser_rollout
Attachments
Comments (2)

Thanks

3dwannab · 2017-02-25

Wow, 2 years ago I posted this. Thanks.

That worked but the BBC Radio1 player doesn't work.

It probably needs an OAuth to run the player from a webbroswer.

johnim · 2017-02-18

add wb.ScriptErrorsSuppressed = true