Can't import passwords from chrome or edge to firefox. Help?
Tried every solution but import works only for bookmarks, cookies, history and not the passwords. When i try to import, it says successful but nothing happens. Tested in both the browsers in their closed state. Earlier also i faced the same problem (i think a year back) which forced me to reject firefox. Please help if u know any solution. Thanks in advance.
Chosen solution
I hadn't tested it recently, but is looks that there needs to be a origin key value pair in Firefox 73 (haven't tested when this got changed).
This works for me as a test:
- [{"username":"x","password":"x","hostname":"https://xxx.com","origin":"https://xxx.com"}]
Here is updated code that adds the origin key when not found that works for me with an older logins.json.
var logins; if (logins = prompt("Logins JSON: [{},{}]","?")){ try { logins = JSON.parse(logins); for(i=o;lg=logins[i];i++){ if(!lg.origin){lg.origin=lg.hostname} } try { /*[60+]*/ ChromeUtils.import("resource://gre/modules/LoginHelper.jsm"); LoginHelper.maybeImportLogins(logins); } catch(e) { /*[42-59]*/ Cu.import("resource://gre/modules/LoginHelper.jsm"); for (i in logins) LoginHelper.maybeImportLogin(logins[i]); } } catch(e){ console.log(e); } }Read this answer in context 👍 0
All Replies (7)
You can possibly try these steps:
- export the passwords in Google Chrome to a CSV file
- convert the CSV file to JSON format using a converting tool like this:
https://www.convertcsv.com/csv-to-json.htm
https://www.convertcsv.com/#faq - import the JSON file in Firefox using the Browser Console
You need to have the JSON in this key:value format as a [{},{}] array: [{"username":"x","password":"x","hostname":"https://"}]
EDIT: see the JavaScript further down for updated code.
Code for the command line in the Browser Console to import logins in JSON format: You need to enable the command line.
(code deleted)
Modified
Hello Yashveer Dabas,
You may already have tried this, but just in case the above doesn't do the trick :
When you go to the 3-bar menu => Logins and Passwords (or type in the address bar about:logins and press Enter), don't click on "Sign in to Sync", but click on the three little dots next to that button instead. There you will see "Import Passwords" .....
cor-el said
You can possibly try these steps:You need to have the JSON in this key:value format as a [{},{}] array: [{"username":"x","password":"x","hostname":"https://"}]
- export the passwords in Google Chrome to a CSV file
- convert the CSV file to JSON format using a converting tool like this:
https://www.convertcsv.com/csv-to-json.htm
https://www.convertcsv.com/#faq- import the JSON file in Firefox using the Browser Console
Code for the command line in the Browser Console to import logins in JSON format: You need to enable the command line.
if (logins = prompt("Logins JSON: [{},{}]","?")){ try { logins = JSON.parse(logins); try { /*[60+]*/ ChromeUtils.import("resource://gre/modules/LoginHelper.jsm"); LoginHelper.maybeImportLogins(logins); } catch(e) { /*[42-59]*/ Cu.import("resource://gre/modules/LoginHelper.jsm"); for (i in newSG) LoginHelper.maybeImportLogin(logins[i]); } } catch(e){ console.log(e); } }
thanks i'll try and update... btw what's causing the issue? thanks
Modified
McCoy said
Hello Yashveer Dabas, You may already have tried this, but just in case the above doesn't do the trick : When you go to the 3-bar menu => Logins and Passwords (or type in the address bar about:logins and press Enter), don't click on "Sign in to Sync", but click on the three little dots next to that button instead. There you will see "Import Passwords" .....
thanks but still it doesn't work....
Quote: btw what's causing the issue?
What issue are you talking about ?
The attached screenshot doesn't seem to be working, so maybe give it another try.
cor-el said
Quote: btw what's causing the issue? What issue are you talking about ? The attached screenshot doesn't seem to be working, so maybe give it another try.
man this stuff is high level for someone who's a doctor..
btw i was able to enable browser console and ran that code which prompted a dialogue labelled Logins JSON: [{},{}] asking something . Screenshot attached.
didn't know what to do pressed ok , nothing happened.
Chosen Solution
I hadn't tested it recently, but is looks that there needs to be a origin key value pair in Firefox 73 (haven't tested when this got changed).
This works for me as a test:
- [{"username":"x","password":"x","hostname":"https://xxx.com","origin":"https://xxx.com"}]
Here is updated code that adds the origin key when not found that works for me with an older logins.json.
var logins; if (logins = prompt("Logins JSON: [{},{}]","?")){ try { logins = JSON.parse(logins); for(i=o;lg=logins[i];i++){ if(!lg.origin){lg.origin=lg.hostname} } try { /*[60+]*/ ChromeUtils.import("resource://gre/modules/LoginHelper.jsm"); LoginHelper.maybeImportLogins(logins); } catch(e) { /*[42-59]*/ Cu.import("resource://gre/modules/LoginHelper.jsm"); for (i in logins) LoginHelper.maybeImportLogin(logins[i]); } } catch(e){ console.log(e); } }
Modified