Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuchunyang/marionette.el
https://github.com/xuchunyang/marionette.el
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/xuchunyang/marionette.el
- Owner: xuchunyang
- License: gpl-3.0
- Created: 2020-03-17T00:44:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-17T00:59:24.000Z (10 months ago)
- Last Synced: 2024-10-16T01:45:55.850Z (3 months ago)
- Language: Emacs Lisp
- Size: 21.5 KB
- Stars: 12
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Control Firefox via the Marionette Protocol
marionette.el lets you control the Firefox web browser via the [Marionette Protocol](https://firefox-source-docs.mozilla.org/testing/marionette/Protocol.html).
To use this library, you need to have a running Firefox instance with the
marionette protocol enabled. To do this, all you have to do is run the firefox
binary with the `-marionette` flag. E.g.,$ /Applications/Firefox.app/Contents/MacOS/firefox -marionette
# For macOS (open(1) does not block your terminal)
$ open -a Firefox --args -marionette``` emacs-lisp
;; Get Title of http://example.com
(marionette-with-page
(lambda (proc)
(marionette-request proc 'Navigate :url "http://example.com")
(marionette-request proc 'GetTitle)))
;; => ((value . "Example Domain"))
`````` emacs-lisp
;; Take Screenshot of http://example.com, save to example.com.png
(marionette-with-page
(lambda (proc)
(marionette-request proc 'Navigate :url "http://example.com")
(let-alist (marionette-request proc 'TakeScreenshot :full t)
(let ((coding-system-for-write 'binary))
(write-region
(base64-decode-string .value)
nil
"example.com.png")))))
```## References
- [Marionette — Mozilla Source Tree Docs 76.0a1 documentation](https://firefox-source-docs.mozilla.org/testing/marionette/index.html)
- [Marionette Commands](https://searchfox.org/mozilla-central/source/testing/marionette/driver.js)
- [gecko-dev/marionette.py at master · mozilla/gecko-dev](https://github.com/mozilla/gecko-dev/blob/master/testing/marionette/client/marionette_driver/marionette.py)
- [WebDriver](https://w3c.github.io/webdriver/)
- [Marionette - Racket](https://docs.racket-lang.org/marionette/index.html)