Reputation: 579
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.
Upvotes: 2
Views: 496
Reputation: 43042
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.
Upvotes: 2