We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Can't import passwords from chrome or edge to firefox. Help?

  • 7 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 cor-el

more options

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.

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.
已附加屏幕截图

被采纳的解决方案

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:

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); }
}
定位到答案原位置 👍 0

所有回复 (7)

more options

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://"}]


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)

由cor-el于修改

more options

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" .....

more options

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://"}]

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

由Yashveer Dabas于修改

more options

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....

more options

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.

more options

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.

more options

选择的解决方案

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:

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); }
}

由cor-el于修改