From d62979de3871bed726e02f7c621d0fe51378d658 Mon Sep 17 00:00:00 2001 From: Ziga Date: Tue, 1 Jun 2021 10:01:48 +0200 Subject: [PATCH] Now extension will collect hostname from current tab and put it on search --- js/passwords.js | 9 +++++++++ manifest.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/js/passwords.js b/js/passwords.js index 5bc5e93..86574ec 100644 --- a/js/passwords.js +++ b/js/passwords.js @@ -60,6 +60,15 @@ function displayPasswords(){ displayPasswords(); +try{ + chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => { + if(tabs[0].url !== null && typeof(tabs[0].url) !== 'undefined'){ + document.getElementById("search").value = new URL(tabs[0].url).hostname.replace("www.", ""); + filterPasswords(); + } + }); +}catch{} + document.getElementById("search").addEventListener("keyup", () => { filterPasswords(); }); diff --git a/manifest.json b/manifest.json index b7ae1ac..bd05e29 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,10 @@ { "name": "Passky", "description": "Simple and secure password manager", - "version": "1.0.3", + "version": "1.0.4", "manifest_version": 2, "author": "Rabbit Company LLC", + "permissions": ["clipboardWrite", "tabs"], "browser_action": { "default_icon": "/images/logo32.png", "default_title": "Passky",