Skip to content

Commit e99edfa

Browse files
author
Sami Vänttinen
authored
Fix HTTP Auth fill (#1869)
Fix HTTP Auth fill
1 parent b525513 commit e99edfa

6 files changed

Lines changed: 29 additions & 25 deletions

File tree

keepassxc-browser/background/event.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ kpxcEvent.messageHandlers = {
228228
'create_new_group': keepass.createNewGroup,
229229
'enable_automatic_reconnect': keepass.enableAutomaticReconnect,
230230
'disable_automatic_reconnect': keepass.disableAutomaticReconnect,
231+
'fill_http_auth': page.fillHttpAuth,
231232
'generate_password': keepass.generatePassword,
232233
'get_color_theme': kpxcEvent.getColorTheme,
233234
'get_connected_database': kpxcEvent.onGetConnectedDatabase,

keepassxc-browser/background/page.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,17 @@ page.getLoginList = async function(tab) {
379379
return [];
380380
};
381381

382+
page.fillHttpAuth = async function(tab, credentials) {
383+
if (page.tabs[tab.id] && page.tabs[tab.id].loginList.resolve) {
384+
page.tabs[tab.id].loginList.resolve({
385+
authCredentials: {
386+
username: credentials.login,
387+
password: credentials.password
388+
}
389+
});
390+
}
391+
};
392+
382393
// Update context menu for attribute filling
383394
page.updateContextMenu = async function(tab, credentials) {
384395
// Remove any old attribute items

keepassxc-browser/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"manifest_version": 2,
33
"name": "KeePassXC-Browser",
4-
"version": "1.8.5",
5-
"version_name": "1.8.5",
4+
"version": "1.8.5.1",
5+
"version_name": "1.8.5.1",
66
"description": "__MSG_extensionDescription__",
77
"author": "KeePassXC Team",
88
"icons": {

keepassxc-browser/popups/popup_httpauth.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
return;
2020
}
2121

22-
if (data.resolve) {
23-
const id = e.target.id;
24-
const creds = data.logins[Number(id)];
25-
data.resolve({
26-
authCredentials: {
27-
username: creds.login,
28-
password: creds.password
29-
}
30-
});
31-
}
22+
const credentials = data.logins[Number(e.target.id)];
23+
browser.runtime.sendMessage({
24+
action: 'fill_http_auth',
25+
args: credentials
26+
});
27+
3228
close();
3329
});
3430
ll.appendChild(a);
@@ -47,16 +43,12 @@
4743
});
4844

4945
$('#btn-dismiss').addEventListener('click', async () => {
50-
const loginData = await getLoginData();
51-
// Using reject won't work with every browser. So return empty credentials instead.
52-
if (loginData.resolve) {
53-
loginData.resolve({
54-
authCredentials: {
55-
username: '',
56-
password: ''
57-
}
58-
});
59-
}
46+
// Return empty credentials
47+
browser.runtime.sendMessage({
48+
action: 'fill_http_auth',
49+
args: { login: '', password: '' }
50+
});
51+
6052
close();
6153
});
6254
})();

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "KeePassXC-Browser",
3-
"version": "1.8.5",
3+
"version": "1.8.5.1",
44
"description": "KeePassXC-Browser",
55
"main": "build.js",
66
"devDependencies": {

0 commit comments

Comments
 (0)