I am trying to build a VS Code extension that can auto-detect if a page has scrollable element and scroll it while making screenshots, so that I can have a list of screenshots with all elements being scrolled, probably one by one. For now, I find that VS Code extension doesn't seem to have the access to not-currently-opened file and is hard to learn if the element is scrollable via the browser (since it is a canvas).
Is there any way to achieve that? I am kinda stuck here.
Extensions do not have access to the DOM. They are meant to extend VS Code from a functional standpoint, which mostly means something file based.
The only way to get access to a part of the DOM is to use a web view, but that allows only access to its own DOM.
So the answer is: what you want to achieve is impossible.