[jawsscripts] Re: HTML DOM with microsoft silverlight

  • From: "Travis Roth" <travis@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 20 May 2013 07:24:16 -0500

Theoretically Silverlight is supposed to use Microsoft's UIAutomation for
accessibility. I do not know that JAWS has any specific UIAutomation
functions? My impression is it mostly is mapping back to MSAA functions.
At any rate the best bet would be to see what information is available via
MSAA/UIAutomation using Microsoft Object Inspect or UISpy. 
That said, I've not came across an accessible Silverlight app or one that
seemed to expose enough to be useful. 



-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of John Martyn
Sent: Friday, May 17, 2013 7:44 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] HTML DOM with microsoft silverlight

Out of curiousity, has anyone successfully engaged with Silverlight? I tried
with the following code to get some information out of Silverlight. The
following code also gives you access to the XMLDom which I used for one Note
and the shell for windows to get the objects on a webpage:
I did notice that Silverlight only lets Javascript to get access to the
object so I am just figuring that JAWS script isn't going to be able to get
anything from the Netflix Silverlight player. Any thoughts?

 

globals

object XMLDom,

object theShell,

object test,

object theBrowser,

int netflixEnable

function NetflixLoader()

 

var

string webAddress,

string domain,

string windowName,

handle currentWindow,

handle theWindow,

int windowCount,

int trigger,

int safety

let domain = GetDomainName ()

if StringCompare (domain, "movies.netflix.com", 0) == 0 then

let XMLDom = CreateObjectEx ("Microsoft.XMLDOM", 2)

Delay (2, 1)

if !XMLDom then

let XMLDom = CreateObject ("Microsoft.XMLDOM")

endif

 

let theShell = CreateObject ("shell.application")

Delay (2, 1)

if !theShell then

let theShell = CreateObjectEx ("shell.application", 2)

Delay (2, 1)

endif

 

let currentWindow = GetAppMainWindow (GetFocus())

let windowCount = theShell.windows.count

;sayinteger(windowCount)

let safety = 0

while trigger != 1

let windowName = theShell.windows(safety).fullName

let windowName = StringSegment (windowName, "\\", -1)

;Say(windowName,3)

if StringCompare (windowName, "iexplore.exe", 0) == 0 then

let theBrowser = theShell.windows(safety)

let theWindow = theBrowser.hWnd

if theWindow == currentWindow then

let trigger = 1

endif

endif

 

if safety >= windowCount-1 then

let trigger = 1

endif

let safety = safety+1

endwhile

let trigger = 0

let safety = 0

let webAddress = theBrowser.locationURL

 

var

string objectID,

object host,

variant dNode,

variant nodeNames,

int nodeCount,

string targetNode,

variant valueData

 

 

let objectID = "SLPlayer"

let host = theBrowser.document.getElementById(objectID)

;let host = host.childNodes.item(0)

;Say(host.GetAttribute("id"),3)

let nodeCount = host.childNodes.length

;sayinteger(nodeCount)

let trigger = 1

while trigger != 1

let targetNode = host.childNodes.item(safety)

Say(targetNode.nodeName,3)

let valueData = valueData+targetNode.nodeName+"\n"

Say(targetNode.childNodes.length,3)

Say(targetNode.GetAttribute("name"),3)

let valueData = valueData+targetNode.GetAttribute("name")+"\n"

;Say(targetNode.GetAttribute("value"),3)

let valueData = valueData+targetNode.GetAttribute("value")+"\n"

if safety >= nodeCount-1 then

let trigger = 1

endif

let safety = safety+1

endwhile

let trigger = 0

let safety = 0

;this is the call to the silverlight application, but findName doesn't
actually return anything

let dNode = host.content.findName("MediaElement1")

 

 

if dNode then

SayString("found")

endif

UserBufferClear ()

UserBufferAddText (valueData)

endif

EndFunction

 

 

function KeyPressedEvent (int keyCode, string keyName)

;sayinteger(keyCode)

if keyCode == 45 then

UserBufferActivate (0)

endif

if keyCode == 44 then

NetFlixLoader()

endif

 

EndFunction

 



__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: