Skip to content

Commit c0ae208

Browse files
committed
feat: prefill host when creating new password
1 parent 176a418 commit c0ae208

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/popup/addEditInterface.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,17 @@ function AddEditInterface(settingsModel) {
284284
} else {
285285
// view instance should be a Login
286286
loginObj = new Login(settings);
287+
288+
const currentTab = // only one tab should be active and in the current window
289+
(
290+
await browser.tabs.query({
291+
active: true,
292+
lastFocusedWindow: true,
293+
})
294+
)[0];
295+
const host = new URL(currentTab.url).host;
296+
// prefill the host of the current tab
297+
loginObj.login = host;
287298
}
288299

289300
// set the storePath and get tree dirs

0 commit comments

Comments
 (0)