R tools that allow me to query information from my Firefox profile data.
These include
and general access to the places.sqlite database.
See also RBrowserCookies for reading cookies.
I tend to have a large number of tabs open - currently 347 across 37 windows, but that is better than before. I used to have over 500 open persistently, growing to 750 at one point.
The functions oldTabs()
, tabInfo()
and fxTabList()
provide information
about tabs.
oldTabs()
returns returns a data.frame with a row for each currently open tab.
The title, URL and last accessed give us plenty of context. The window (the title of the window) and the window and tab number help us find the tab in the open browser.
bookmarkDF()
returns a data.frame describing the hierarchy of bookmarks, i.e.,
identify a bookmark and the folder it is in, etc.
It is useful for + finding duplicates, + finding ones that might be in the wrong folder
Each row in the data.frame corresponds to a bookmark. We have the + title of the bookmark + URI + sequence of ancestor folders, as string separated by ";" + depth in the hierarchy of this bookmark.
places()
returns a data.frame with a row for each page visited in the browser history.
This can be useful to find, for example, + all stackoverflow pages one has visited and by date. This can help find pages you recall, but don't fully remember and need to find. + what pages you visit most ofen +
There are 17 columns (not in order) + title - title of the page that appears in the + description - possible longer of description of the page + url - the page's URL + visit_count - how many times we visited this + last_visit_date - the date and time (POSIXct) that we visited this page + host + typed + id + rev_host + hidden + frecency + guid + foreign_count + url_hash + preview_image_url + origin_id</p> <p>(<code>site_name</code> is all NAs, at least in my database.)</p> <h2>Downloads</h2> <p><code>downloads()</code> allows us to find out when we downloaded a file and from where, and the collection of files from a particular site.</p> <p><code>downloads()</code> returns a data.frame with 25 columns, joining the <code>moz_annos</code> table with the <code>moz_places</code> table in the <code>places.sqlite</code> database.</p> <ul> <li>content</li> <li>type</li> <li>url</li> <li>title</li> <li>description</li> </ul> <h2>Connecting Places & Visits</h2> <p><code>visits()</code> joins the moz_historyvisits and moz_places table. This allows us to + find the path we took to a particular page and the type of "hops" we took, e.g., following a link, a bookmark, a download, a reload + when we visited pages</p> <h2>Accessing the places.sqlite Database</h2> <pre><code>db = conPlacesDB() dbListTable(db) </code></pre> <h2>Profiles</h2> <p><code>getProfile()</code> returns the full path to the unique default profile, or the most recently used default profile.</p> <p>If you want a different profile, you can specify the uniquely identifying string for that profile, e.g., <code>getProfile("qs")</code> or <code>getProfile("^qs")</code> or <code>getProfile("Protected")</code>.</p> <p>You set the profile identified as an option with, e.g.,</p> <pre><code class="r">options(FirefoxProfile = "^qs") </code></pre> <p><code>listProfiles(, TRUE)</code> lists all of the profiles. It returns a data.frame describing each profile. This includes + the Name, + the directory + whether this is a default profile + the label + the version of the profile + whether it is locked oor not + whether StartWithLastProfile is TRUE or FALSE</p> <h2>Passwords</h2> <p><code>readPasswords()</code> gets the passwords for the specified profile. By default, this returns a data.frame containing + host + password + login/user name</p> <p>By default, the password is decrypted, but will print as XXX. The actual decrypted value(s) can be accessed directly to use as inputs to calls or to view.</p> <p>We can also get all of the information for each login-password pair with</p> <pre><code class="r">readPasswords(full = TRUE) </code></pre> <p>For each login-password, the resulting data.frame includes the associated + host + password + login + times the login was created, changed, last used + number of times used + URL for the form and corresponding fields in the HTML form</p> <h2>References</h2> <ul> <li> <p>See https://medium.com/geekculture/how-to-hack-firefox-passwords-with-python-a394abf18016 for information about the steps for accessing and decrypting the passwords.</p> </li> <li> <p><a href="https://github.com/unode/firefox_decrypt.git">firefox_decrypt</a> is a Python application/program to access Firefox passwords for any of the profiles. </p> </li> </ul> <h2>Installation</h2> <p>You will need libnss and libnspr.</p> <ul> <li>I built it from source on my older MacbookPro (Intel).</li> <li>On the M1/Apple Silicon, I installed it from <a href="https://formulae.brew.sh/formula/nss">homebrew</a>.</li> </ul> <p><-- I had a version of nspr installed directly from source and then one from brew. The former was bad. had @excutable_path in the .dylib.</p> <p>On M1, I then needed to map the dynamic libraries to /usr/local/lib</p> <pre><code>install_name_tool -change @executable_path/libplds4.dylib /usr/local/lib/libplds4.dylib src/RFirefoxData.so install_name_tool -change @executable_path/libplc4.dylib /usr/local/lib/libplc4.dylib src/RFirefoxData.so install_name_tool -change @executable_path/libnspr4.dylib /usr/local/lib/libnspr4.dylib src/RFirefoxData.so </code></pre> <p>But this did not suffice. The file /usr/local/lib/libnspr4.dylib, for example, contained</p> <pre><code>@executable_path/libnspr4.dylib (compatibility version 1.0.0, current version 1.0.0) </code></pre> <p>Removing the .dylib's, include/nspr and nspr.pc from /usr/local/ got things working. --></p>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.