0.0.1 • Published 5 years ago

headless-page-watcher v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

headless-page-watcher

NPM version

Monitor a live web page for changes using a headless browser


This is a work-around. I want to be able to use Google Docs as live data sources for software. Unfortunately, Google's drive.files.watch API, using webhooks, does not track changes closely. When someone opens the watched document and starts typing, the first two changes get propogated quickly, then no more for a long long time.

So here, instead, we open the doc in a headless browser and watch the DOM for changes. It's fast, at least. But obviously uses a ton of resources to have the headless browser process sitting there. Probably better to just poll the HTML view of the document, for most applications.


In theory, this should work for any live pages, not just Google Docs, but I haven't tested others.