Skip to content

Instantly share code, notes, and snippets.

@jscher2000
jscher2000 / scroungehistory.js
Created June 18, 2017 17:33
Console Script to Scrounge Title and URLs from a Firefox Session History File
/* Open old session history file in a tab, open the web console, paste all of this, press Enter to execute.
If popup is blocked, allow popups then try again. */
function scrub(t){t=t.replace(/&/g,'&amp;'); t=t.replace(/>/g,'&gt;'); t=t.replace(/</g,'&lt;'); return t;}
if (window.confirm('Scrounge session URLs?')) var newwin=window.open();
if (newwin){
newwin.document.write('<!DOCTYPE html>\n<html><head><title>URLs Scrounged from Session History</title><meta http-equiv=\'Content-Type\' content=\'text/html; charset=UTF-8\'><style>.urllist>p{margin-left:2.25em}.urllist>p:nth-of-type(1){margin-left:0}</style></head>\n');
newwin.document.write('<body><h1>URLs Scrounged from Session History</h1>\n');
var out=new Array();
var sess=document.body.textContent.split('"_closedWindows":[');
console.log(sess.length);
@jscher2000
jscher2000 / download-progress-button.css
Created June 21, 2017 16:09
Style Firefox downloads toolbar button as a progress bar with enlarged text (compatible with Firefox 54)
/* Style Downloads button (show progress) and Panel (show details after completion) */
/* TOOLBAR BUTTON TWEAKS */
/* During a download, hide the arrow */
#downloads-button[progress] #downloads-indicator-icon {
display: none !important;
}
/* During a download, force display of progress bar */
#downloads-button[progress] #downloads-indicator-progress-area {
display: -moz-box !important;
visibility: visible !important;
@jscher2000
jscher2000 / decompress-jsonlz4-session-history.txt
Last active March 29, 2019 22:36
Browser Console code snippet to Decompress Firefox 56 jsonlz4 Session History file
/*
FOR FIREFOX 66+, USE THE FOLLOWING SCRIPT INSTEAD:
https://gist.github.com/jscher2000/4403507e33df0918289619edb83f8193
NOTE: BEFORE RUNNING THIS SCRIPT, CHECK THIS SETTING:
Type or paste about:config into the address bar and press Enter
Click the button promising to be careful
In the search box type devt and pause while Firefox filters the list
If devtools.chrome.enabled is false, double-click it to toggle to true
@jscher2000
jscher2000 / decompress-mozlz4-snippet.js
Last active March 18, 2024 03:10
Browser Console Snippet to decompress mozlz4 and jsonlz4 files
/* Decompression Script for the Browser Console
NOTE: BEFORE RUNNING THIS SCRIPT, CHECK THIS SETTING:
Type or paste about:config into the address bar and press Enter
Click the button promising to be careful
In the search box type devt and pause while Firefox filters the list
If devtools.chrome.enabled is false, double-click it to toggle to true
Paste this entire script into the command line at the bottom of the Browser Console (Windows: Ctrl+Shift+j)
Then press Enter to run the script. A file picker should promptly open.
@jscher2000
jscher2000 / Hide_Media_Play_Command.user.js
Created November 5, 2017 22:19
Hide the play command for video elements
// ==UserScript==
// @name Hide Media Play Command
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// ==/UserScript==
/* Supplements but does not replace media.autoplay.enabled = false
* PROBLEM: in testing on YouTube, userStart() reports "pending" and the video doesn't play, when it's the initial page load.
* Videos you load from thumbnails work as expected. */
@jscher2000
jscher2000 / color-gray-bookmark-folders.css
Last active November 11, 2017 07:15
Color the gray folder and other container icons in Firefox 56+
/* Colored bookmark sidebar, toolbar, menu button containers */
/* Standard folder */
#bookmarks-view treechildren::-moz-tree-image(container),
#PlacesToolbarItems toolbarbutton[container="true"] .toolbarbutton-icon,
#PlacesToolbarItems menu[container="true"] .menu-iconic-left,
#BMB_bookmarksPopup menu[container="true"] .menu-iconic-icon {
fill: #e8bb00 !important; /* slightly muted gold */
}
/* Live Bookmark (RSS Feed) */
#bookmarks-view treechildren::-moz-tree-image(container, livemark),
@jscher2000
jscher2000 / firefox-edge-light-dark.css
Created November 11, 2017 21:04
"Dark" user style from https://userstyles.org/styles/135593/firefox-edge-light-dark (Author sapierens License CC BY)
/* Firefox Edge v1.12.0 */
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@-moz-document url("chrome://browser/content/browser.xul"),
url("chrome://browser/content/bookmarks/bookmarksPanel.xul"),
url("chrome://browser/content/history/history-panel.xul") {
:root {
--chrome-background-color: var(--second-level-bg-color) !important;
--chrome-secondary-background-color: var(--top-level-bg-color) !important;
/* Firefox Edge v1.12.0 */
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@-moz-document url("chrome://browser/content/browser.xul"),
url("chrome://browser/content/bookmarks/bookmarksPanel.xul"),
url("chrome://browser/content/history/history-panel.xul") {
:root {
--chrome-background-color: var(--second-level-bg-color) !important;
--chrome-secondary-background-color: var(--top-level-bg-color) !important;
@jscher2000
jscher2000 / addon-update-date.js
Last active September 26, 2019 15:19
Browser Console Script to Show Latest Add-on Update Dates
var AM = Components.utils.import("resource://gre/modules/AddonManager.jsm");
AM.AddonManager.getAllAddons().then((aAddonsList) => {
var updatelog = [];
for (let addon of aAddonsList) {
if (addon.updateDate && !addon.hidden){
var strActive = (addon.isActive) ? ' (Enabled)' : ' (Disabled)';
var dt = addon.updateDate;
dt.setMinutes(dt.getMinutes() - dt.getTimezoneOffset());
var strDateTime = dt.toISOString();
strDateTime = strDateTime.substr(0, strDateTime.indexOf('T')) + ' ' + addon.updateDate.toLocaleTimeString();
@jscher2000
jscher2000 / gist:3ff0d847db967a3d8c2385a5de05a677
Created April 6, 2018 02:44
Fix Gmail Message Times When Resisting Fingerprinting (user script / pre-alpha)
// ==UserScript==
// @name Fix Gmail Message Times When Resisting Fingerprinting
// @author Jefferson "jscher2000" Scher
// @namespace JeffersonScher
// @version 0.1 Pre-Alpha
// @copyright Copyright 2018 Jefferson Scher
// @license BSD-3-Clause
// @include https://mail.google.com/mail/*
// @grant GM_registerMenuCommand
// ==/UserScript==