marzPT
marzPT

Reputation: 15

Make automated browser scripts into node.js

I make these browser scripts in JavaScript and use them in tamper monkey or the console. I make these scripts for various tasks like automating different functions on websites that are not mine. I was wondering if there is a way to use these scripts without the browser but as a desktop application. I have heard about node.js and hopefully I can use it for what I want. I'm not really familiar with node.js but use applications made by node.

Thanks!

Upvotes: 0

Views: 1246

Answers (2)

Alex Wachira
Alex Wachira

Reputation: 1335

Currently speaking you can't do that with desktop applications made with Native APIs like .NET Windows Applications or Cocoa OSX applications, because what you're doing with TamperMonkey is manipulating the Webpage(DOM) which is usually not accessible, when it is there in desktop applications.

The only desktop apps you might be able to do that on, are Electron apps since they're using the DOM, if you have access to the dev tools in the app you can run JavaScript just like in Chrome dev tools.

Look into AutoHotkey for automating keystrokes and mouse clicks if you're on Windows, see if it might help you automate according to your needs.

Upvotes: 0

Avi Mosseri
Avi Mosseri

Reputation: 1368

nodejs isn't really what you are looking for even though what you are looking to do can be accomplished using libraries written for nodejs. Look into PhantomJS and Selenium (webdriver.io)

Upvotes: 2

Related Questions