Firefox extension mod article
This commit is contained in:
parent
cc38f170f5
commit
45224fd9c8
7 changed files with 63 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 231 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 465 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 140 KiB |
63
content/personal-blog/modifying-firefox-extensions/index.md
Normal file
63
content/personal-blog/modifying-firefox-extensions/index.md
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
+++
|
||||||
|
title = 'Modifying A Buggy Browser Extension'
|
||||||
|
description = '1Password has been misbehaving lately, lets fix it!'
|
||||||
|
date = 2026-01-06T16:20:00-05:00
|
||||||
|
draft = false
|
||||||
|
categories = ['guides']
|
||||||
|
tags = ['Firefox', 'Browser Extensions', '1Password']
|
||||||
|
disableToc = false
|
||||||
|
+++
|
||||||
|
|
||||||
|
# The 1Password browser extension has been misbehaving lately... lets fix it!
|
||||||
|
<!--more-->
|
||||||
|
|
||||||
|
The problem that I have been having is a recent bug introduced into 1Password where it will not autofill on local http websites. The reason for this is a problem importing window.crypto.randomUUID() within a non-secure context and is outlined [here](https://www.1password.community/discussions/1password/re-enable-auto-fill-for-localhost-local-ip-network-device-websites/165052).
|
||||||
|
|
||||||
|
This guide will walk you through how to fix this issue, and also how to modify other Firefox extensions.
|
||||||
|
|
||||||
|
## Step 1: Figure out where your Firefox profile is stored
|
||||||
|
|
||||||
|
Open a new firefox tab and type **about:support** into the url bar. Then find the **Profile Directory** section and click the **Open Directory** button.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Step 2: Extract the extension
|
||||||
|
|
||||||
|
Within the Firefox profile directory, go into the **extensions** folder and you will find one .xpi file for each extension you are using in Firefox. One of these extensions will be the one you want.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
I have found the easiest way to figure out which .xpi file is correct is to open them up in an archive manager (you can rename the file to *.zip first if you want), then check inside the **credits.html** file.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The extension name is near the top under <meta content=[EXTENSION_NAME]/>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Step 3: Edit the extension
|
||||||
|
|
||||||
|
To solve our particular problem, extract this whole .xpi file into a new folder. We will want to edit the /[Folder Name]/inline/injected.js file.
|
||||||
|
|
||||||
|
Open a new terminal window here (in the folder with injected.js) and run:
|
||||||
|
```sh
|
||||||
|
sed -i 's/QDe=yte==="client"?window\.crypto\.randomUUID()\.slice(0,8):void 0/QDe=yte==="client"\&\&window.crypto.randomUUID?window.crypto.randomUUID().slice(0,8):void 0/g' injected.js
|
||||||
|
```
|
||||||
|
|
||||||
|
This uses sed to find and replace a string. We are replacing the existing call to window.crypto.randomUUID() to a ternary operator which will check if window.crypto.randomUUID exists and if so use it, if not fall back to void 0 (undefined) which will cause the existing 1Password code to fall back to a counter-based ID instead.
|
||||||
|
|
||||||
|
Note that this sed statement will not work if the 1Password extension significantly changes, so you may need to modify it. Hopefully if the extension changes it means the maintainers have fixed this bug and we don't need to do this in the first place!
|
||||||
|
|
||||||
|
## Step 4: Add the modified extension into Firefox
|
||||||
|
|
||||||
|
In a Firefox tab go to **about:debugging#/runtime/this-firefox**
|
||||||
|
|
||||||
|
Click the **Load Temporary Add-on** button.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Load the addon by pointing to your **/[Folder Name]/manifest.json** file.
|
||||||
|
|
||||||
|
1Password should now offer to autofill on http websites as normal.
|
||||||
|
|
||||||
|
All done!!!
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Loading…
Add table
Reference in a new issue