-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Accessibility Panel #87
Improve Accessibility Panel #87
Conversation
evt.preventDefault() | ||
chrome.devtools.inspectedWindow.eval( | ||
"inspect($$(\"" + this.path.replace('"', '\\"') + "\")[0])", | ||
function(result, isException) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a internal helper that is promise-based instead of callback-based you might want to use here.
https://github.com/electron/devtron/blob/master/lib/eval.js#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I missed that 😊 . Fixed
This is great 👍
Is the path forward here to open up a pull request upstream to make this a public API? |
This way axs can be built from npm _and_ be available to execute in the browser
Thanks! Yes, that might work but... the method generates selectors for an element and seems to only be used internally to generate error messages. Before creating an Issue, I thought I'd solicit feedback on an approach that does not require exposing I just pushed a commit (7f1d782) that is more accurate than relying on a generated CSS selector. It is also similar to how react-devtools solved the same problem. If that strategy seems convoluted or more difficult to maintain I submitted Getting access to the package in the browserI was unable to get the electron app access to // This code does not work
exports.audit = () => {
return Eval.execute(function () {
// This code is serialized and runs in the browser.
// It currently relies on the content_scripts in manifest.json to get access to axs via the window.__devtron.axs global
const axs = require('accessibility-developer-tools')
const config = new axs.AuditConfiguration({showUnsupportedRulesWarning: false}) ... I added There is probably a better way that I missed, but I could not figure it out. |
@@ -0,0 +1,8 @@ | |||
// This defines globals that will be used in the browser context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the filename here should be browser-globals.js
to match the naming convention of the other files in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, 😊 . Fixed!
Really cool, thanks for this 👍 |
Published in 1.4.0 🎉 |
This seems kinda blog-worthy. |
Thanks for adding tools to help make electron apps more accessible!
I stumbled upon this while fixing accessibility-developer-tools#291 and as a long-time Atom user/hacker, thought I'd leave this repository a little better off than how I found it.
TODO
accessibility-developer-tools
module instead of usingvendor/axs.js
accessibility.js
uses a private function namedaxs.utils.getQuerySelectorText(element)