Skip to content
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

[Question]: Draw bound box on the Website #2083

Open
Justin-Xiang opened this issue Nov 2, 2024 · 3 comments
Open

[Question]: Draw bound box on the Website #2083

Justin-Xiang opened this issue Nov 2, 2024 · 3 comments
Labels
extension-checker Issues related to the browser extensions question Further information is requested user-reported Issues identified outside of the core team

Comments

@Justin-Xiang
Copy link

Project

accessibility-checker for Node

Description

Hi Developers,

I've noticed a bounding box in the result JSON file when using accessibility-checker. I'd like to know the resolution that accessibility-checker uses, as I want to accurately draw the bounding box on the website. The values in the JSON appear to be absolute positions.

Thanks in advance!

@Justin-Xiang
Copy link
Author

sample codes:

const aChecker = require("accessibility-checker");

aChecker
    .getCompliance("https://www.reddit.com", "Reddit")
    .then((results) => {
        const report = results.report;
        console.log(report);
    })
    .catch((err) => {
        console.error(err);
    })
    .finally(() => {
        aChecker.close().catch(console.error);
    });

@MHoov MHoov added question Further information is requested user-reported Issues identified outside of the core team extension-checker Issues related to the browser extensions labels Nov 4, 2024
@tombrunet
Copy link
Member

Resolution isn't applicable within a web page context. They're referred to as "CSS pixels", which are device agnostic. Resolution is a property of the screenshot, so it depends on the mechanism by which you're taking a screenshot and what device the screenshot was taken on.

@Justin-Xiang
Copy link
Author

I’m using the code above to inspect an HTML file, and in my results.json, I get bounds values such as left, top, height, and width. My question is: what viewport size is used to test this HTML file? Knowing this would allow me to accurately draw the bounding box. For instance, if the test is performed at 800x600 or 1200x960, using the same values to draw a bounding box would yield different results depending on the viewport size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-checker Issues related to the browser extensions question Further information is requested user-reported Issues identified outside of the core team
Projects
None yet
Development

No branches or pull requests

3 participants