# Documentation of Tor Browser's JS API

**URL:** https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631
**Category:** Tor Browser Desktop
**Tags:** tor-browser
**Created:** [July 16, 2024, 11:15am UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631 "2024-07-16T11:15:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Noino](https://forum.torproject.org/letter_avatar_proxy/v4/letter/n/ed655f/32.png) [@Noino](https://forum.torproject.org/u/Noino)
#### Post date: [July 16, 2024, 11:15am UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631/1 "2024-07-16T11:15:09Z")

</div>

I’d be very grateful if someone could point me at the public JS API documentation for specific TB functionality - e.g. documentation on how to [change Tor circuit for a site](https://forum.torproject.org/t/how-to-change-circuit-programmatically-in-torbrowser/10611/3). My guess is that some of TB’s functionality is accessible via the various FF JS API’s (Chrome DevTools?) but I have not been able to find this documented anywhere.

If this question is better addressed as an issue on TB’s GitLab source code page I’ll head over there (I see the devs forum here is read only). Many thanks.

---

<div class="post-metadata">

### Author: ![morgan](https://forum.torproject.org/user_avatar/forum.torproject.org/morgan/32/4895_2.png) [@morgan](https://forum.torproject.org/u/morgan)
#### Post date: [July 20, 2024, 6:13pm UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631/2 "2024-07-20T18:13:28Z")

</div>

We don’t have any public facing documentation for our internal Tor Brower JS APIs. You _can_ look at the source in-tree or in the chrome-ui debugger; most of our added JS modules are named `Tor*.sys.mjs` with I’m sure some exceptions.

Broadly speaking though, I would not recommend building anything off of these APIs, as we make absolutely no effort to maintain any kind of versioning scheme, backward compatibility, etc. These are internal private APIs so please don’t expect them to remain stable over time.

That said, it may be helpful to understand _why_ you want to access this functionality programmatically? Is there some UI deficit that needs to be addressed?

---

<div class="post-metadata">

### Author: ![Noino](https://forum.torproject.org/letter_avatar_proxy/v4/letter/n/ed655f/32.png) [@Noino](https://forum.torproject.org/u/Noino)
#### Post date: [July 20, 2024, 9:34pm UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631/3 "2024-07-20T21:34:49Z")

</div>

@morgan

Caveat understood, thanks. I am writing an extension for Selenium for Tor Browser (in Ruby). My project is at [GitLab.com](http://GitLab.com) under /matzfan/selenium-tor - for some reason I can’t post a link to it here.

EDIT: [matzfan / Selenium Tor · GitLab](https://gitlab.com/matzfan/selenium-tor) -richard 🙂

---

<div class="post-metadata">

### Author: ![morgan](https://forum.torproject.org/user_avatar/forum.torproject.org/morgan/32/4895_2.png) [@morgan](https://forum.torproject.org/u/morgan)
#### Post date: [July 20, 2024, 9:48pm UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631/4 "2024-07-20T21:48:55Z")

</div>

@Noino hey that’s pretty neat! There is also: [GitHub - webfp/tor-browser-selenium: Tor Browser automation with Selenium.](https://github.com/webfp/tor-browser-selenium)

Would you like us to add you as a downstream dependency to contact during our release process to notify you when we change and potentially break things for you in alpha? Let me know and we can add your email to the check-list 🙂

---

<div class="post-metadata">

### Author: ![Noino](https://forum.torproject.org/letter_avatar_proxy/v4/letter/n/ed655f/32.png) [@Noino](https://forum.torproject.org/u/Noino)
#### Post date: [July 21, 2024, 11:22am UTC](https://forum.torproject.org/t/documentation-of-tor-browsers-js-api/13631/5 "2024-07-21T11:22:50Z")

</div>

@morgan

I’m familiar with that python project and have taken some inspiration from it (I must credit the authors in my own project). It would be great to be added to your downstream deps list, thanks.
