2

I am working on a firefox addon that will automatically populate the login form fields and login. What I have access to could be anything from id's classes' or the xpath to the login button depending on what the website gives. The priority captured will usually be id's if they exist. The specific website that won't trigger the click is: https://login.paylocity.com/escher/escher_webui/views/login/login.aspx

I tried using $(element).trigger('click') or $(element).click() and they both don't trigger the click automatically. The error in the console log shows:

XrayWrapper denied access to property callee (reason: value is callable). See https://developer.mozilla.org/en-US/docs/Xray_vision for more information. Note that only the first denied property access from a given global object will be reported.

I also tried the Javascript method shown here: Is it possible to trigger a link's (or any element's) click event through JavaScript? That doesn't work either.

Community
  • 1
  • 1
Kabu
  • 539
  • 2
  • 6
  • 18
  • Try `$('#form').submit()` perhaps – Tomanow Jan 26 '15 at 23:32
  • Try without hte dollar sign, tyr document.getElementById('elementId').click() if that fails too then you can always for sure do it this way: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.initMouseEvent that error you posted probably should help us figure this out, i dont understand it though – Noitidart Jan 27 '15 at 01:46
  • @Tomanow I can't do `$('#form').submit()` since there could be click handlers on the login button itself that needs to be fired. Thanks @Noitidart can't do find element by ID since some websites don't use id's for their login buttons so I edited in my question above that sometimes I would have access to the id, class, the whole element or even the xpath depending on how the website is structured. I still get that error using the simulate click. Thanks – Kabu Jan 27 '15 at 19:16

1 Answers1

2

XrayWrapper denied access to property callee

This suggests that the script is running in an environment that has higher privileges than the page content itself, which in turn results in some security barriers (the xray wrappers in one direction, access denied errors in the other) since the caller now is partially privileged code which content is not allowed to access.

Instead of using jquery you could try manually synthesizing a DOM event and firing it, possibly by accessing the unsafe window.

Something along the lines of new window.wrappedJSObject.MouseEvent("click"), same for dispatchEvent().

Alternatively you could also try firing a submit event on the form instead of a click event.

Yet another approach is to make .callee accessible by transplanting the calling function into the content window.

the8472
  • 40,999
  • 5
  • 70
  • 122