Search code examples
javascriptwindowswebbrowserdevtools

Is it possible to emulate developer tools of a browser, outside of a browser? (send message to browser console via 3rd party program)


The title is rather confusing, let me explain more thoroughly. There is a website to which i can send certain functions via the developer console of the browser.The website is mostly JavaScript. I would like to automate this without using the browser itself. I can already automate this using a script and greesemonkey/tampermonkey. The problem is, it is taxing on the computer as more than one instance is running. As you might know browsers tend to slow down inactive tabs, so I create a new window for each instance yet again it's taxing.


Things I've tried: I've tried many programs, add-ons to sniff HTTP packets to create a bot using AutoIt. They worked quite well on most websites unfortunately not on the one I would like to. I've tried creating a form based application on Visual Studio, basically creating a web browser and going from there.(The difference between this and using an actual browser would be I would be able set web browser visible to false and assuming it would be very low demanding) After my research I've realized that there is no way to enable developer tools as they run on internet explorer itself. Any suggestions are welcome.


Solution

  • If you are using Windows, there is actually an "F12 DevTools" thing built into Windows. I've found it doesn't always detect the running app you're trying to attach to, but there's now a better one on the Windows Store:

    https://www.microsoft.com/en-gb/p/microsoft-edge-devtools-preview/9mzbfrmz0mnj?activetab=pivot:overviewtab

    There's more info about both the Windows built-in one and the store app here. I have used both versions to attach to an HTML-based Office 365 add-in running in the Desktop edition of Outlook. The experience is very similar to using Chrome devtools when the add-in is running in OWA.

    These Windows devtools let you do most of the same things you do in a browser's devtools including viewing console output, issuing console commands, setting breakpoints and examining/changing variable values.