搜尋 Mozilla 技術支援網站

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 7 回覆
  • 1 有這個問題
  • 21 次檢視
  • 最近回覆由 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.

附加的畫面擷圖

被選擇的解決方法

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 於 修改

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題