How to import passwords from Opera to PM?

Users and developers helping users with technical Pale Moon issues (Windows and other non-Linux O.S.). Please direct questions about the Linux version to the appropriate Linux board.

Moderators: trava90, satrow

Forum rules
This board is for technical/usage questions and troubleshooting for the Pale Moon browser only. The main focus here is on Pale Moon on Windows. Please direct your questions for Linux, Android and Mac to the dedicated boards.
Technical issues and questions not related to the Pale Moon browser should be posted in "technical chat"
Please keep off-topic and general discussion out of this board, thank you!
User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1756
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Import passwords from FF58+

Unread post by JustOff » 2018-12-17, 17:59

Due to repeated requests, I finally implemented the basic support for importing passwords from Firefox 58+ (key4.db). To do this, you need to navigate to the desired profile and select the logins.json file in the import dialog. Master password protected data is not supported yet, you must first disable it in the source browser.

At the moment, this feature should be considered as experimental, so do not forget to backup your workplace.
Here are the add-ons I made in a spare time. That was fun!

User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1756
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Password Backup Tool

Unread post by JustOff » 2018-12-27, 13:16

Password Backup Tool has been updated to 1.2.1:
  • Add support for importing passwords from Firefox 58+ profiles (raw and password protected)
Here are the add-ons I made in a spare time. That was fun!

User avatar
bawldiggle
Lunatic
Lunatic
Posts: 394
Joined: 2013-02-22, 21:16
Location: Australia

Re: Import PM passwords into a clean PM install ?

Unread post by bawldiggle » 2019-01-05, 00:06

PM has been very unstable over several months, with a new profile there has been a marginal improvement but not brilliant.
A clean install is my next step.

:?: If I copy the old profile to a safe folder (with PM closed of course !) ... can I direct Password Backup Tool to the "safe" folder ?
- I have about 4 or more years of passwords and the thought of losing them is too much to "bear"

Thank you :)

Palemoon : v28.2.2 (32-bit)
Win-7 PRO x64
The only thing that keeps this Pale Moon Project afloat is $$$$$$ ... spelt "m-o-n-e-y" everything else is just talk
Donate to the Pale Moon project here

doofy
Lunatic
Lunatic
Posts: 437
Joined: 2017-08-14, 23:43

Re: Import PM passwords into a clean PM install ?

Unread post by doofy » 2019-01-05, 00:16

bawldiggle wrote:If I copy the old profile to a safe folder (with PM closed of course !) ... can I direct Password Backup Tool to the "safe" folder ?
- I have about 4 or more years of passwords and the thought of losing them is too much to "bear"
I use Password Exporter 1.3.4, and what I would do is export passwords before backing up my profile.

Can you not do that with PBT?

User avatar
bawldiggle
Lunatic
Lunatic
Posts: 394
Joined: 2013-02-22, 21:16
Location: Australia

Re: How to import passwords from Opera to PM?

Unread post by bawldiggle » 2019-01-05, 01:39

@doofy :)

I have not got that far yet. Still planning how to save (recycle) Passwords Metadata, Cookies and cookie-Exclusions.
Thanks for the tip to Password Exporter 1.3.4 ... I will have a look at it.
The only thing that keeps this Pale Moon Project afloat is $$$$$$ ... spelt "m-o-n-e-y" everything else is just talk
Donate to the Pale Moon project here

User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1756
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: How to import passwords from Opera to PM?

Unread post by JustOff » 2019-01-05, 12:32

bawldiggle wrote:Thanks for the tip to Password Exporter 1.3.4 ... I will have a look at it.
I do not recommend you to use Password Exporter, as it contains bugs that are fixed in Password Backup Tool. You can export your passwords from the old profile using PBT and then import them into a new one, or simply exit the browser and copy logins.json and key3.db from the old to the new profile.
Here are the add-ons I made in a spare time. That was fun!

mekineer
Moon lover
Moon lover
Posts: 81
Joined: 2013-11-22, 09:01
Location: nyc

Re: How to import passwords from Opera to PM?

Unread post by mekineer » 2019-04-13, 22:44

What is the Chrome json formatting that is expected by the Password Backup Tool? I am trying to imitate it, but I don't have an example to follow. I get: "Error: Couldn't get data from the Chrome password database"

mekineer
Moon lover
Moon lover
Posts: 81
Joined: 2013-11-22, 09:01
Location: nyc

Re: How to import passwords from Opera to PM?

Unread post by mekineer » 2019-04-13, 23:20

Also, I want to add, that I have a script to scrape the passwords from Google Chrome, and instructions on how to use it. The script was made by Saro Saribekyan.

1) Have Chrome installed, and you need to log into chrome with your google account, if you haven't already done so.
2) Set up Chrome sync, if you haven't already done so.
3) Pull up Chrome settings, and view your passwords.
4) Zoom out of the page as far as it will go.
4) Ctrl-Shift-J to open the console.
5) Copy the script below, and paste it into the console. Press enter.
6) Call the function collect(). Do this by typiing "collect()" without quotes, and press enter. The purpose is to get all your passwords to show on the page. Scroll down to the bottom of the page, and call the collect() function again. Do this ad nauseam, until no new passwords are appearing.
7) Call the function download(), which will bring up a save dialog, where you can save your passwords in json format.

Code: Select all

valuesArray = [];

function download(fileName) {

    if (isEmptyOrSpaces(fileName)) {
        fileName = "Google-Passwords";
    }

    fileName += ".json";

    var file = JSON.stringify(valuesArray);

    return downloadFile(file, fileName, "application/json");
}
function downloadFile(strData, strFileName, strMimeType) {
    var D = document,
        A = arguments,
        a = D.createElement("a"),
        d = A[0],
        n = A[1],
        t = A[2] || "text/plain";

    //build download link:
    a.href = "data:" + strMimeType + "charset=utf-8," + escape(strData);


    if (window.MSBlobBuilder) { // IE10
        var bb = new MSBlobBuilder();
        bb.append(strData);
        return navigator.msSaveBlob(bb, strFileName);
    } /* end if(window.MSBlobBuilder) */



    if ('download' in a) { //FF20, CH19
        a.setAttribute("download", n);
        a.innerHTML = "downloading...";
        D.body.appendChild(a);
        setTimeout(function () {
            var e = D.createEvent("MouseEvents");
            e.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
            a.dispatchEvent(e);
            D.body.removeChild(a);
        }, 66);
        return true;
    }; /* end if('download' in a) */



    //do iframe dataURL download: (older W3)
    var f = D.createElement("iframe");
    D.body.appendChild(f);
    f.src = "data:" + (A[2] ? A[2] : "application/octet-stream") + (window.btoa ? ";base64" : "") + "," + (window.btoa ? window.btoa : escape)(strData);
    setTimeout(function () {
        D.body.removeChild(f);
    }, 333);
    return true;
}
function isEmptyOrSpaces(str) {
    return str == null || str == undefined || str.match(/^ *$/) !== null;
}
function getListItem() {
    var list = getLastShadow().querySelector('div.list-frame iron-list#passwordList');
    return list;
}

function getList() {
    var list = getListItem().getElementsByTagName('password-list-item');
    return list;
}

function getLastShadow() {
    var shadow = document.querySelector('settings-ui').shadowRoot.querySelector('div#container').querySelector('settings-main').shadowRoot.querySelector('settings-basic-page.showing-subpage').shadowRoot.querySelector('div#basicPage settings-section settings-autofill-page').shadowRoot.querySelector('settings-animated-pages#pages settings-subpage passwords-section').shadowRoot;
    return shadow;
}

function getItemValues(item) {
    var innerItem = item.shadowRoot.querySelector('div.list-item');

    var domain = innerItem.querySelector('div.website-column a#originUrl span.text-elide bdo').innerText;
    var username = innerItem.querySelector('input#username').value;

    var passwordColumn = innerItem.querySelector('div.password-column');

    var pass = passwordColumn.querySelector('input#password').value;

    var itemValues = { domain: domain, username: username, password: pass };

    return itemValues;
}

function uncoverPasswords(list) {
    for (i = 0; i < list.length;i++) {
        var innerItem = list[i].shadowRoot.querySelector('div.list-item');

        var passwordColumn = innerItem.querySelector('div.password-column');
        var pass = passwordColumn.querySelector('input#password').value;

        if (isEmptyOrSpaces(pass)) {
            passwordColumn.querySelector('paper-icon-button-light button').click();
        }
    }
}

function addItem(item) {
    var exist = false;

    for (i = 0; i < valuesArray.length; i++) {
        if (valuesArray[i].domain == item.domain && valuesArray[i].username == item.username && valuesArray[i].password == item.password) {
            exist = true;
            break;
        }
    }
    
    if (!exist) {
        valuesArray.push(item);
    }
}

function collect() {
    var list = getList();

    uncoverPasswords(list);

    setTimeout(function () {

        for (var i = 0; i < list.length; i++) {
            var item = getItemValues(list[i]);
            addItem(item);
        }

        console.log("Collected: " + valuesArray.length);
    }, 200);

}

mekineer
Moon lover
Moon lover
Posts: 81
Joined: 2013-11-22, 09:01
Location: nyc

Re: How to import passwords from Opera to PM?

Unread post by mekineer » 2019-04-14, 01:12

Ok, this was unnecessary. I didn't see that the Backup Tool could already do this.
https://addons.palemoon.org/addon/password-backup-tool/

Post Reply