小工具整理
No files matched your search
@@ -0,0 +1 @@
|
||||
<html><head><meta charset="UTF-8"/><script defer="defer" src="vendor.js"></script><script defer="defer" src="background.js"></script></head><body></body></html>
|
||||
@@ -0,0 +1,2 @@
|
||||
(()=>{var e,t={42227:(e,t,i)=>{"use strict";var n,s,r,o,a,l;!function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(n||(n={})),function(e){e[e.None=0]="None",e[e.Password=1]="Password"}(s||(s={})),function(e){e[e.Login=1]="Login",e[e.SecureNote=2]="SecureNote",e[e.Card=3]="Card",e[e.Identity=4]="Identity"}(r||(r={}));class c{constructor(e){this.accountConstructor=e}create(e){return new this.accountConstructor(e)}}class d{constructor(e){this.globalStateConstructor=e}create(e){return new this.globalStateConstructor(e)}}class u{constructor(e,t){this.globalStateFactory=new d(e),this.accountFactory=new c(t)}createGlobal(e){return this.globalStateFactory.create(e)}createAccount(e){return this.accountFactory.create(e)}}!function(e){e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e[e.Four=4]="Four",e[e.Five=5]="Five",e[e.Six=6]="Six",e[e.Latest=6]="Latest"}(o||(o={})),function(e){e.System="system",e.Light="light",e.Dark="dark",e.Nord="nord",e.SolarizedDark="solarizedDark"}(a||(a={}));class h{constructor(){this.base=null,this.api=null,this.identity=null,this.icons=null,this.notifications=null,this.events=null,this.webVault=null,this.keyConnector=null}static fromJSON(e){return Object.assign(new h,e)}}class p{}class y{constructor(){this.theme=a.System,this.window=new p,this.stateVersion=o.One,this.environmentUrls=new h}}!function(e){e[e.Android=0]="Android",e[e.iOS=1]="iOS",e[e.ChromeExtension=2]="ChromeExtension",e[e.FirefoxExtension=3]="FirefoxExtension",e[e.OperaExtension=4]="OperaExtension",e[e.EdgeExtension=5]="EdgeExtension",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.MacOsDesktop=7]="MacOsDesktop",e[e.LinuxDesktop=8]="LinuxDesktop",e[e.ChromeBrowser=9]="ChromeBrowser",e[e.FirefoxBrowser=10]="FirefoxBrowser",e[e.OperaBrowser=11]="OperaBrowser",e[e.EdgeBrowser=12]="EdgeBrowser",e[e.IEBrowser=13]="IEBrowser",e[e.UnknownBrowser=14]="UnknownBrowser",e[e.AndroidAmazon=15]="AndroidAmazon",e[e.UWP=16]="UWP",e[e.SafariBrowser=17]="SafariBrowser",e[e.VivaldiBrowser=18]="VivaldiBrowser",e[e.VivaldiExtension=19]="VivaldiExtension",e[e.SafariExtension=20]="SafariExtension"}(l||(l={}));var v=i(96905),g=i(71469);const m="undefined"==typeof window?i(50209):null;class f{static init(){f.inited||(f.inited=!0,f.isNode=void 0!==g&&null!=g.release&&"node"===g.release.name,f.isBrowser="undefined"!=typeof window,f.isMobileBrowser=f.isBrowser&&this.isMobile(window),f.isAppleMobileBrowser=f.isBrowser&&this.isAppleMobile(window),f.isNode?f.global=i.g:f.isBrowser?f.global=window:f.global=self)}static fromB64ToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=f.global.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromUrlB64ToArray(e){return f.fromB64ToArray(f.fromUrlB64ToB64(e))}static fromHexToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"hex"));{const t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=parseInt(e.substr(i,2),16);return t}}static fromUtf8ToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"utf8"));{const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromByteStringToArray(e){if(null==e)return null;const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}static fromBufferToB64(e){if(f.isNode)return Buffer.from(e).toString("base64");{let t="";const i=new Uint8Array(e);for(let e=0;e<i.byteLength;e++)t+=String.fromCharCode(i[e]);return f.global.btoa(t)}}static fromBufferToUrlB64(e){return f.fromB64toUrlB64(f.fromBufferToB64(e))}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToUtf8(e){if(f.isNode)return Buffer.from(e).toString("utf8");{const t=new Uint8Array(e),i=String.fromCharCode.apply(null,t);return decodeURIComponent(escape(i))}}static fromBufferToByteString(e){return String.fromCharCode.apply(null,new Uint8Array(e))}static fromBufferToHex(e){if(f.isNode)return Buffer.from(e).toString("hex");{const t=new Uint8Array(e);return Array.prototype.map.call(t,(e=>("00"+e.toString(16)).slice(-2))).join("")}}static fromUrlB64ToB64(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}return t}static fromUrlB64ToUtf8(e){return f.fromB64ToUtf8(f.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return f.isNode?Buffer.from(e,"utf8").toString("base64"):decodeURIComponent(escape(f.global.btoa(e)))}static fromUtf8ToUrlB64(e){return f.fromBufferToUrlB64(f.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return f.isNode?Buffer.from(e,"base64").toString("utf8"):decodeURIComponent(escape(f.global.atob(e)))}static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}static isGuid(e){return RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5Line truncated
|
||||
//# sourceMappingURL=background.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background.js","mappings":"UAAIA,E,gCCAJ,IAAYC,ECAAC,ECAAC,ECAAC,ECAAC,ECAAC,GLAZ,SAAYL,GACV,6BACA,uBACA,0BACD,CAJD,CAAYA,IAAAA,EAAoB,KCAhC,SAAYC,GACV,mBACA,0BACD,CAHD,CAAYA,IAAAA,EAAkB,KCA9B,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KAAcH,EAAIG,KAAO,I,CACnD,SACA,OAAO,I,CAEX,CAEArF,iBAAiBiF,GACf,GAAiB,MAAbA,EACF,OAAO,KAIT,GAAkB,MADlBA,EAAYA,EAAUK,QAEpB,OAAO,KAGT,GAAIL,EAAUM,WAAW,SACvB,OAAO,KAGT,IAAIC,EAAUP,EAAUM,WAAW,YAAcN,EAAUM,WAAW,YAWtE,IATGC,GACDP,EAAUQ,QAAQ,OAAS,GAC3B5E,EAAM6E,eAAeV,KAAKC,IAC1BA,EAAUQ,QAAQ,KAAO,IAEzBR,EAAY,UAAYA,EACxBO,GAAU,GAGRA,EACF,IACE,MAAMN,EAAMrE,EAAM8E,aAAaV,GAE/B,KADwC,OAAlBW,aAAK,EAALA,EAAA,UAAyBA,EAAMC,QAAQX,EAAIE,WAE/D,OAAO,KAGT,GAAqB,cAAjBF,EAAIE,UAA4BvE,EAAMiF,eAAeZ,EAAIE,UAC3D,OAAOF,EAAIE,SAGb,MAAMW,EACK,MAATH,GAAoC,MAALine truncated
|
||||
@@ -0,0 +1,36 @@
|
||||
@-webkit-keyframes bitwardenfill {
|
||||
0% {
|
||||
-webkit-transform: scale(1, 1);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1.2, 1.2);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale(1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes bitwardenfill {
|
||||
0% {
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(1.2, 1.2);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
span[data-bwautofill].com-bitwarden-browser-animated-fill {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.com-bitwarden-browser-animated-fill {
|
||||
animation: bitwardenfill 200ms ease-in-out 0ms 1;
|
||||
-webkit-animation: bitwardenfill 200ms ease-in-out 0ms 1;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
let pageHref = null;
|
||||
let filledThisHref = false;
|
||||
let delayFillTimeout;
|
||||
const activeUserIdKey = "activeUserId";
|
||||
let activeUserId;
|
||||
chrome.storage.local.get(activeUserIdKey, (obj) => {
|
||||
if (obj == null || obj[activeUserIdKey] == null) {
|
||||
return;
|
||||
}
|
||||
activeUserId = obj[activeUserIdKey];
|
||||
});
|
||||
chrome.storage.local.get(activeUserId, (obj) => {
|
||||
var _a, _b;
|
||||
if (((_b = (_a = obj === null || obj === void 0 ? void 0 : obj[activeUserId]) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.enableAutoFillOnPageLoad) === true) {
|
||||
setInterval(() => doFillIfNeeded(), 500);
|
||||
}
|
||||
});
|
||||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
if (msg.command === "fillForm" && pageHref === msg.url) {
|
||||
filledThisHref = true;
|
||||
}
|
||||
});
|
||||
function doFillIfNeeded(force = false) {
|
||||
if (force || pageHref !== window.location.href) {
|
||||
if (!force) {
|
||||
// Some websites are slow and rendering all page content. Try to fill again later
|
||||
// if we haven't already.
|
||||
filledThisHref = false;
|
||||
if (delayFillTimeout != null) {
|
||||
window.clearTimeout(delayFillTimeout);
|
||||
}
|
||||
delayFillTimeout = window.setTimeout(() => {
|
||||
if (!filledThisHref) {
|
||||
doFillIfNeeded(true);
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
pageHref = window.location.href;
|
||||
const msg = {
|
||||
command: "bgCollectPageDetails",
|
||||
sender: "autofiller",
|
||||
};
|
||||
chrome.runtime.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,64 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
const inputTags = ["input", "textarea", "select"];
|
||||
const labelTags = ["label", "span"];
|
||||
const attributes = ["id", "name", "label-aria", "placeholder"];
|
||||
const invalidElement = chrome.i18n.getMessage("copyCustomFieldNameInvalidElement");
|
||||
const noUniqueIdentifier = chrome.i18n.getMessage("copyCustomFieldNameNotUnique");
|
||||
let clickedEl = null;
|
||||
// Find the best attribute to be used as the Name for an element in a custom field.
|
||||
function getClickedElementIdentifier() {
|
||||
var _a, _b;
|
||||
if (clickedEl == null) {
|
||||
return invalidElement;
|
||||
}
|
||||
const clickedTag = clickedEl.nodeName.toLowerCase();
|
||||
let inputEl = null;
|
||||
// Try to identify the input element (which may not be the clicked element)
|
||||
if (labelTags.includes(clickedTag)) {
|
||||
let inputId = null;
|
||||
if (clickedTag === "label") {
|
||||
inputId = clickedEl.getAttribute("for");
|
||||
}
|
||||
else {
|
||||
inputId = (_a = clickedEl.closest("label")) === null || _a === void 0 ? void 0 : _a.getAttribute("for");
|
||||
}
|
||||
inputEl = document.getElementById(inputId);
|
||||
}
|
||||
else {
|
||||
inputEl = clickedEl;
|
||||
}
|
||||
if (inputEl == null || !inputTags.includes(inputEl.nodeName.toLowerCase())) {
|
||||
return invalidElement;
|
||||
}
|
||||
for (const attr of attributes) {
|
||||
const attributeValue = inputEl.getAttribute(attr);
|
||||
const selector = "[" + attr + '="' + attributeValue + '"]';
|
||||
if (!isNullOrEmpty(attributeValue) && ((_b = document.querySelectorAll(selector)) === null || _b === void 0 ? void 0 : _b.length) === 1) {
|
||||
return attributeValue;
|
||||
}
|
||||
}
|
||||
return noUniqueIdentifier;
|
||||
}
|
||||
function isNullOrEmpty(s) {
|
||||
return s == null || s === "";
|
||||
}
|
||||
// We only have access to the element that's been clicked when the context menu is first opened.
|
||||
// Remember it for use later.
|
||||
document.addEventListener("contextmenu", (event) => {
|
||||
clickedEl = event.target;
|
||||
});
|
||||
// Runs when the 'Copy Custom Field Name' context menu item is actually clicked.
|
||||
chrome.runtime.onMessage.addListener((event) => {
|
||||
if (event.command === "getClickedElement") {
|
||||
const identifier = getClickedElementIdentifier();
|
||||
chrome.runtime.sendMessage({
|
||||
command: "getClickedElementResponse",
|
||||
sender: "contextMenuHandler",
|
||||
identifier: identifier,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,37 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
window.addEventListener("message", (event) => {
|
||||
if (event.source !== window) {
|
||||
return;
|
||||
}
|
||||
if (event.data.command && event.data.command === "authResult") {
|
||||
chrome.runtime.sendMessage({
|
||||
command: event.data.command,
|
||||
code: event.data.code,
|
||||
state: event.data.state,
|
||||
referrer: event.source.location.hostname,
|
||||
});
|
||||
}
|
||||
if (event.data.command && event.data.command === "webAuthnResult") {
|
||||
chrome.runtime.sendMessage({
|
||||
command: event.data.command,
|
||||
data: event.data.data,
|
||||
remember: event.data.remember,
|
||||
referrer: event.source.location.hostname,
|
||||
});
|
||||
}
|
||||
}, false);
|
||||
const forwardCommands = [
|
||||
"promptForLogin",
|
||||
"addToLockedVaultPendingNotifications",
|
||||
"unlockCompleted",
|
||||
"addedCipher",
|
||||
];
|
||||
chrome.runtime.onMessage.addListener((event) => {
|
||||
if (forwardCommands.includes(event.command)) {
|
||||
chrome.runtime.sendMessage(event);
|
||||
}
|
||||
});
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
@@ -0,0 +1,531 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
var __webpack_exports__ = {};
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
if (window.location.hostname.endsWith("vault.bitwarden.com")) {
|
||||
return;
|
||||
}
|
||||
const pageDetails = [];
|
||||
const formData = [];
|
||||
let barType = null;
|
||||
let pageHref = null;
|
||||
let observer = null;
|
||||
const observeIgnoredElements = new Set([
|
||||
"a",
|
||||
"i",
|
||||
"b",
|
||||
"strong",
|
||||
"span",
|
||||
"code",
|
||||
"br",
|
||||
"img",
|
||||
"small",
|
||||
"em",
|
||||
"hr",
|
||||
]);
|
||||
let domObservationCollectTimeout = null;
|
||||
let collectIfNeededTimeout = null;
|
||||
let observeDomTimeout = null;
|
||||
const inIframe = isInIframe();
|
||||
const cancelButtonNames = new Set(["cancel", "close", "back"]);
|
||||
const logInButtonNames = new Set([
|
||||
"log in",
|
||||
"sign in",
|
||||
"login",
|
||||
"go",
|
||||
"submit",
|
||||
"continue",
|
||||
"next",
|
||||
]);
|
||||
const changePasswordButtonNames = new Set([
|
||||
"save password",
|
||||
"update password",
|
||||
"change password",
|
||||
"change",
|
||||
]);
|
||||
const changePasswordButtonContainsNames = new Set(["pass", "change", "contras", "senha"]);
|
||||
let disabledAddLoginNotification = false;
|
||||
let disabledChangedPasswordNotification = false;
|
||||
const activeUserIdKey = "activeUserId";
|
||||
let activeUserId;
|
||||
chrome.storage.local.get(activeUserIdKey, (obj) => {
|
||||
if (obj == null || obj[activeUserIdKey] == null) {
|
||||
return;
|
||||
}
|
||||
activeUserId = obj[activeUserIdKey];
|
||||
});
|
||||
chrome.storage.local.get(activeUserId, (obj) => {
|
||||
if ((obj === null || obj === void 0 ? void 0 : obj[activeUserId]) == null) {
|
||||
return;
|
||||
}
|
||||
const domains = obj[activeUserId].settings.neverDomains;
|
||||
// eslint-disable-next-line
|
||||
if (domains != null && domains.hasOwnProperty(window.location.hostname)) {
|
||||
return;
|
||||
}
|
||||
disabledAddLoginNotification = obj[activeUserId].settings.disableAddLoginNotification;
|
||||
disabledChangedPasswordNotification =
|
||||
obj[activeUserId].settings.disableChangedPasswordNotification;
|
||||
if (!disabledAddLoginNotification || !disabledChangedPasswordNotification) {
|
||||
collectIfNeededWithTimeout();
|
||||
}
|
||||
});
|
||||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
processMessages(msg, sendResponse);
|
||||
});
|
||||
function processMessages(msg, sendResponse) {
|
||||
if (msg.command === "openNotificationBar") {
|
||||
if (inIframe) {
|
||||
return;
|
||||
}
|
||||
closeExistingAndOpenBar(msg.data.type, msg.data.typeData);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
else if (msg.command === "closeNotificationBar") {
|
||||
if (inIframe) {
|
||||
return;
|
||||
}
|
||||
closeBar(true);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
else if (msg.command === "adjustNotificationBar") {
|
||||
if (inIframe) {
|
||||
return;
|
||||
}
|
||||
adjustBar(msg.data);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
else if (msg.command === "notificationBarPageDetails") {
|
||||
pageDetails.push(msg.data.details);
|
||||
watchForms(msg.data.forms);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function isInIframe() {
|
||||
try {
|
||||
return window.self !== window.top;
|
||||
}
|
||||
catch (_a) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function observeDom() {
|
||||
const bodies = document.querySelectorAll("body");
|
||||
if (bodies && bodies.length > 0) {
|
||||
observer = new MutationObserver((mutations) => {
|
||||
if (mutations == null || mutations.length === 0 || pageHref !== window.location.href) {
|
||||
return;
|
||||
}
|
||||
let doCollect = false;
|
||||
for (let i = 0; i < mutations.length; i++) {
|
||||
const mutation = mutations[i];
|
||||
if (mutation.addedNodes == null || mutation.addedNodes.length === 0) {
|
||||
continue;
|
||||
}
|
||||
for (let j = 0; j < mutation.addedNodes.length; j++) {
|
||||
const addedNode = mutation.addedNodes[j];
|
||||
if (addedNode == null) {
|
||||
continue;
|
||||
}
|
||||
const tagName = addedNode.tagName != null ? addedNode.tagName.toLowerCase() : null;
|
||||
if (tagName != null &&
|
||||
tagName === "form" &&
|
||||
(addedNode.dataset == null || !addedNode.dataset.bitwardenWatching)) {
|
||||
doCollect = true;
|
||||
break;
|
||||
}
|
||||
if ((tagName != null && observeIgnoredElements.has(tagName)) ||
|
||||
addedNode.querySelectorAll == null) {
|
||||
continue;
|
||||
}
|
||||
const forms = addedNode.querySelectorAll("form:not([data-bitwarden-watching])");
|
||||
if (forms != null && forms.length > 0) {
|
||||
doCollect = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (doCollect) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (doCollect) {
|
||||
if (domObservationCollectTimeout != null) {
|
||||
window.clearTimeout(domObservationCollectTimeout);
|
||||
}
|
||||
domObservationCollectTimeout = window.setTimeout(collect, 1000);
|
||||
}
|
||||
});
|
||||
observer.observe(bodies[0], { childList: true, subtree: true });
|
||||
}
|
||||
}
|
||||
function collectIfNeededWithTimeout() {
|
||||
if (collectIfNeededTimeout != null) {
|
||||
window.clearTimeout(collectIfNeededTimeout);
|
||||
}
|
||||
collectIfNeededTimeout = window.setTimeout(collectIfNeeded, 1000);
|
||||
}
|
||||
function collectIfNeeded() {
|
||||
if (pageHref !== window.location.href) {
|
||||
pageHref = window.location.href;
|
||||
if (observer) {
|
||||
observer.disconnect();
|
||||
observer = null;
|
||||
}
|
||||
collect();
|
||||
if (observeDomTimeout != null) {
|
||||
window.clearTimeout(observeDomTimeout);
|
||||
}
|
||||
observeDomTimeout = window.setTimeout(observeDom, 1000);
|
||||
}
|
||||
if (collectIfNeededTimeout != null) {
|
||||
window.clearTimeout(collectIfNeededTimeout);
|
||||
}
|
||||
collectIfNeededTimeout = window.setTimeout(collectIfNeeded, 1000);
|
||||
}
|
||||
function collect() {
|
||||
sendPlatformMessage({
|
||||
command: "bgCollectPageDetails",
|
||||
sender: "notificationBar",
|
||||
});
|
||||
}
|
||||
function watchForms(forms) {
|
||||
if (forms == null || forms.length === 0) {
|
||||
return;
|
||||
}
|
||||
forms.forEach((f) => {
|
||||
const formId = f.form != null ? f.form.htmlID : null;
|
||||
let formEl = null;
|
||||
if (formId != null && formId !== "") {
|
||||
formEl = document.getElementById(formId);
|
||||
}
|
||||
if (formEl == null) {
|
||||
const index = parseInt(f.form.opid.split("__")[2], null);
|
||||
formEl = document.getElementsByTagName("form")[index];
|
||||
}
|
||||
if (formEl != null && formEl.dataset.bitwardenWatching !== "1") {
|
||||
const formDataObj = {
|
||||
data: f,
|
||||
formEl: formEl,
|
||||
usernameEl: null,
|
||||
passwordEl: null,
|
||||
passwordEls: null,
|
||||
};
|
||||
locateFields(formDataObj);
|
||||
formData.push(formDataObj);
|
||||
listen(formEl);
|
||||
formEl.dataset.bitwardenWatching = "1";
|
||||
}
|
||||
});
|
||||
}
|
||||
function listen(form) {
|
||||
form.removeEventListener("submit", formSubmitted, false);
|
||||
form.addEventListener("submit", formSubmitted, false);
|
||||
const submitButton = getSubmitButton(form, logInButtonNames);
|
||||
if (submitButton != null) {
|
||||
submitButton.removeEventListener("click", formSubmitted, false);
|
||||
submitButton.addEventListener("click", formSubmitted, false);
|
||||
}
|
||||
}
|
||||
function locateFields(formDataObj) {
|
||||
const inputs = Array.from(document.getElementsByTagName("input"));
|
||||
formDataObj.usernameEl = locateField(formDataObj.formEl, formDataObj.data.username, inputs);
|
||||
if (formDataObj.usernameEl != null && formDataObj.data.password != null) {
|
||||
formDataObj.passwordEl = locatePassword(formDataObj.formEl, formDataObj.data.password, inputs, true);
|
||||
}
|
||||
else if (formDataObj.data.passwords != null) {
|
||||
formDataObj.passwordEls = [];
|
||||
formDataObj.data.passwords.forEach((pData) => {
|
||||
const el = locatePassword(formDataObj.formEl, pData, inputs, false);
|
||||
if (el != null) {
|
||||
formDataObj.passwordEls.push(el);
|
||||
}
|
||||
});
|
||||
if (formDataObj.passwordEls.length === 0) {
|
||||
formDataObj.passwordEls = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
function locatePassword(form, passwordData, inputs, doLastFallback) {
|
||||
let el = locateField(form, passwordData, inputs);
|
||||
if (el != null && el.type !== "password") {
|
||||
el = null;
|
||||
}
|
||||
if (doLastFallback && el == null) {
|
||||
el = form.querySelector('input[type="password"]');
|
||||
}
|
||||
return el;
|
||||
}
|
||||
function locateField(form, fieldData, inputs) {
|
||||
if (fieldData == null) {
|
||||
return;
|
||||
}
|
||||
let el = null;
|
||||
if (fieldData.htmlID != null && fieldData.htmlID !== "") {
|
||||
try {
|
||||
el = form.querySelector("#" + fieldData.htmlID);
|
||||
}
|
||||
catch (_a) {
|
||||
// Ignore error, we perform fallbacks below.
|
||||
}
|
||||
}
|
||||
if (el == null && fieldData.htmlName != null && fieldData.htmlName !== "") {
|
||||
el = form.querySelector('input[name="' + fieldData.htmlName + '"]');
|
||||
}
|
||||
if (el == null && fieldData.elementNumber != null) {
|
||||
el = inputs[fieldData.elementNumber];
|
||||
}
|
||||
return el;
|
||||
}
|
||||
function formSubmitted(e) {
|
||||
let form = null;
|
||||
if (e.type === "click") {
|
||||
form = e.target.closest("form");
|
||||
if (form == null) {
|
||||
const parentModal = e.target.closest("div.modal");
|
||||
if (parentModal != null) {
|
||||
const modalForms = parentModal.querySelectorAll("form");
|
||||
if (modalForms.length === 1) {
|
||||
form = modalForms[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
form = e.target;
|
||||
}
|
||||
if (form == null || form.dataset.bitwardenProcessed === "1") {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < formData.length; i++) {
|
||||
if (formData[i].formEl !== form) {
|
||||
continue;
|
||||
}
|
||||
const disabledBoth = disabledChangedPasswordNotification && disabledAddLoginNotification;
|
||||
if (!disabledBoth && formData[i].usernameEl != null && formData[i].passwordEl != null) {
|
||||
const login = {
|
||||
username: formData[i].usernameEl.value,
|
||||
password: formData[i].passwordEl.value,
|
||||
url: document.URL,
|
||||
};
|
||||
if (login.username != null &&
|
||||
login.username !== "" &&
|
||||
login.password != null &&
|
||||
login.password !== "") {
|
||||
processedForm(form);
|
||||
sendPlatformMessage({
|
||||
command: "bgAddLogin",
|
||||
login: login,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!disabledChangedPasswordNotification && formData[i].passwordEls != null) {
|
||||
const passwords = formData[i].passwordEls
|
||||
.filter((el) => el.value != null && el.value !== "")
|
||||
.map((el) => el.value);
|
||||
let curPass = null;
|
||||
let newPass = null;
|
||||
let newPassOnly = false;
|
||||
if (formData[i].passwordEls.length === 3 && passwords.length === 3) {
|
||||
newPass = passwords[1];
|
||||
if (passwords[0] !== newPass && newPass === passwords[2]) {
|
||||
curPass = passwords[0];
|
||||
}
|
||||
else if (newPass !== passwords[2] && passwords[0] === newPass) {
|
||||
curPass = passwords[2];
|
||||
}
|
||||
}
|
||||
else if (formData[i].passwordEls.length === 2 && passwords.length === 2) {
|
||||
if (passwords[0] === passwords[1]) {
|
||||
newPassOnly = true;
|
||||
newPass = passwords[0];
|
||||
curPass = null;
|
||||
}
|
||||
else {
|
||||
const buttonText = getButtonText(getSubmitButton(form, changePasswordButtonNames));
|
||||
const matches = Array.from(changePasswordButtonContainsNames).filter((n) => buttonText.indexOf(n) > -1);
|
||||
if (matches.length > 0) {
|
||||
curPass = passwords[0];
|
||||
newPass = passwords[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((newPass != null && curPass != null) || (newPassOnly && newPass != null)) {
|
||||
processedForm(form);
|
||||
const changePasswordRuntimeMessage = {
|
||||
newPassword: newPass,
|
||||
currentPassword: curPass,
|
||||
url: document.URL,
|
||||
};
|
||||
sendPlatformMessage({
|
||||
command: "bgChangedPassword",
|
||||
data: changePasswordRuntimeMessage,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function getSubmitButton(wrappingEl, buttonNames) {
|
||||
if (wrappingEl == null) {
|
||||
return null;
|
||||
}
|
||||
const wrappingElIsForm = wrappingEl.tagName.toLowerCase() === "form";
|
||||
let submitButton = wrappingEl.querySelector('input[type="submit"], input[type="image"], ' + 'button[type="submit"]');
|
||||
if (submitButton == null && wrappingElIsForm) {
|
||||
submitButton = wrappingEl.querySelector("button:not([type])");
|
||||
if (submitButton != null) {
|
||||
const buttonText = getButtonText(submitButton);
|
||||
if (buttonText != null && cancelButtonNames.has(buttonText.trim().toLowerCase())) {
|
||||
submitButton = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (submitButton == null) {
|
||||
const possibleSubmitButtons = Array.from(wrappingEl.querySelectorAll('a, span, button[type="button"], ' + 'input[type="button"], button:not([type])'));
|
||||
let typelessButton = null;
|
||||
possibleSubmitButtons.forEach((button) => {
|
||||
if (submitButton != null || button == null || button.tagName == null) {
|
||||
return;
|
||||
}
|
||||
const buttonText = getButtonText(button);
|
||||
if (buttonText != null) {
|
||||
if (typelessButton != null &&
|
||||
button.tagName.toLowerCase() === "button" &&
|
||||
button.getAttribute("type") == null &&
|
||||
!cancelButtonNames.has(buttonText.trim().toLowerCase())) {
|
||||
typelessButton = button;
|
||||
}
|
||||
else if (buttonNames.has(buttonText.trim().toLowerCase())) {
|
||||
submitButton = button;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (submitButton == null && typelessButton != null) {
|
||||
submitButton = typelessButton;
|
||||
}
|
||||
}
|
||||
if (submitButton == null && wrappingElIsForm) {
|
||||
// Maybe it's in a modal?
|
||||
const parentModal = wrappingEl.closest("div.modal");
|
||||
if (parentModal != null) {
|
||||
const modalForms = parentModal.querySelectorAll("form");
|
||||
if (modalForms.length === 1) {
|
||||
submitButton = getSubmitButton(parentModal, buttonNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
return submitButton;
|
||||
}
|
||||
function getButtonText(button) {
|
||||
let buttonText = null;
|
||||
if (button.tagName.toLowerCase() === "input") {
|
||||
buttonText = button.value;
|
||||
}
|
||||
else {
|
||||
buttonText = button.innerText;
|
||||
}
|
||||
return buttonText;
|
||||
}
|
||||
function processedForm(form) {
|
||||
form.dataset.bitwardenProcessed = "1";
|
||||
window.setTimeout(() => {
|
||||
form.dataset.bitwardenProcessed = "0";
|
||||
}, 500);
|
||||
}
|
||||
function closeExistingAndOpenBar(type, typeData) {
|
||||
let barPage = "notification/bar.html";
|
||||
switch (type) {
|
||||
case "add":
|
||||
barPage = barPage + "?add=1&isVaultLocked=" + typeData.isVaultLocked;
|
||||
break;
|
||||
case "change":
|
||||
barPage = barPage + "?change=1&isVaultLocked=" + typeData.isVaultLocked;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
const frame = document.getElementById("bit-notification-bar-iframe");
|
||||
if (frame != null && frame.src.indexOf(barPage) >= 0) {
|
||||
return;
|
||||
}
|
||||
closeBar(false);
|
||||
openBar(type, barPage);
|
||||
}
|
||||
function openBar(type, barPage) {
|
||||
barType = type;
|
||||
if (document.body == null) {
|
||||
return;
|
||||
}
|
||||
const barPageUrl = chrome.extension.getURL(barPage);
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.style.cssText = "height: 42px; width: 100%; border: 0; min-height: initial;";
|
||||
iframe.id = "bit-notification-bar-iframe";
|
||||
iframe.src = barPageUrl;
|
||||
const frameDiv = document.createElement("div");
|
||||
frameDiv.setAttribute("aria-live", "polite");
|
||||
frameDiv.id = "bit-notification-bar";
|
||||
frameDiv.style.cssText =
|
||||
"height: 42px; width: 100%; top: 0; left: 0; padding: 0; position: fixed; " +
|
||||
"z-index: 2147483647; visibility: visible;";
|
||||
frameDiv.appendChild(iframe);
|
||||
document.body.appendChild(frameDiv);
|
||||
iframe.contentWindow.location = barPageUrl;
|
||||
const spacer = document.createElement("div");
|
||||
spacer.id = "bit-notification-bar-spacer";
|
||||
spacer.style.cssText = "height: 42px;";
|
||||
document.body.insertBefore(spacer, document.body.firstChild);
|
||||
}
|
||||
function closeBar(explicitClose) {
|
||||
const barEl = document.getElementById("bit-notification-bar");
|
||||
if (barEl != null) {
|
||||
barEl.parentElement.removeChild(barEl);
|
||||
}
|
||||
const spacerEl = document.getElementById("bit-notification-bar-spacer");
|
||||
if (spacerEl) {
|
||||
spacerEl.parentElement.removeChild(spacerEl);
|
||||
}
|
||||
if (!explicitClose) {
|
||||
return;
|
||||
}
|
||||
switch (barType) {
|
||||
case "add":
|
||||
sendPlatformMessage({
|
||||
command: "bgAddClose",
|
||||
});
|
||||
break;
|
||||
case "change":
|
||||
sendPlatformMessage({
|
||||
command: "bgChangeClose",
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
function adjustBar(data) {
|
||||
if (data != null && data.height !== 42) {
|
||||
const newHeight = data.height + "px";
|
||||
doHeightAdjustment("bit-notification-bar-iframe", newHeight);
|
||||
doHeightAdjustment("bit-notification-bar", newHeight);
|
||||
doHeightAdjustment("bit-notification-bar-spacer", newHeight);
|
||||
}
|
||||
}
|
||||
function doHeightAdjustment(elId, heightStyle) {
|
||||
const el = document.getElementById(elId);
|
||||
if (el != null) {
|
||||
el.style.height = heightStyle;
|
||||
}
|
||||
}
|
||||
function sendPlatformMessage(msg) {
|
||||
chrome.runtime.sendMessage(msg);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
|
After Width: | Height: | Size: 288 B |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 385 B |
|
After Width: | Height: | Size: 645 B |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 553 B |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 921 B |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"environment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"base": {
|
||||
"type": "string",
|
||||
"description": "Base url, typically only this value needs to be set"
|
||||
},
|
||||
"webVault": { "type": "string" },
|
||||
"api": { "type": "string" },
|
||||
"identity": { "type": "string" },
|
||||
"icons": { "type": "string" },
|
||||
"notifications": { "type": "string" },
|
||||
"events": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "__MSG_extName__",
|
||||
"short_name": "__MSG_appName__",
|
||||
"version": "2022.10.1",
|
||||
"description": "__MSG_extDesc__",
|
||||
"default_locale": "en",
|
||||
"author": "Bitwarden Inc.",
|
||||
"homepage_url": "https://bitwarden.com",
|
||||
"icons": {
|
||||
"16": "images/icon16.png",
|
||||
"32": "images/icon32.png",
|
||||
"48": "images/icon48.png",
|
||||
"96": "images/icon96.png",
|
||||
"128": "images/icon128.png"
|
||||
},
|
||||
"content_scripts": [{
|
||||
"all_frames": true,
|
||||
"js": ["content/autofill.js", "content/autofiller.js", "content/notificationBar.js", "content/contextMenuHandler.js"],
|
||||
"matches": ["http://*/*", "https://*/*", "file:///*"],
|
||||
"run_at": "document_start"
|
||||
}, {
|
||||
"all_frames": false,
|
||||
"js": ["content/message_handler.js"],
|
||||
"matches": ["http://*/*", "https://*/*", "file:///*"],
|
||||
"run_at": "document_start"
|
||||
}, {
|
||||
"all_frames": true,
|
||||
"css": ["content/autofill.css"],
|
||||
"matches": ["http://*/*", "https://*/*", "file:///*"],
|
||||
"run_at": "document_end"
|
||||
}],
|
||||
"background": {
|
||||
"page": "background.html",
|
||||
"persistent": true
|
||||
},
|
||||
"browser_action": {
|
||||
"default_icon": {
|
||||
"19": "images/icon19.png",
|
||||
"38": "images/icon38.png"
|
||||
},
|
||||
"default_title": "Bitwarden",
|
||||
"default_popup": "popup/index.html"
|
||||
},
|
||||
"permissions": ["tabs", "contextMenus", "storage", "unlimitedStorage", "clipboardRead", "clipboardWrite", "idle", "http://*/*", "https://*/*", "webRequest", "webRequestBlocking"],
|
||||
"optional_permissions": ["nativeMessaging"],
|
||||
"commands": {
|
||||
"_execute_browser_action": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+Y",
|
||||
"linux": "Ctrl+Shift+U"
|
||||
},
|
||||
"description": "__MSG_commandOpenPopup__"
|
||||
},
|
||||
"autofill_login": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+L"
|
||||
},
|
||||
"description": "__MSG_commandAutofillDesc__"
|
||||
},
|
||||
"generate_password": {
|
||||
"suggested_key": {
|
||||
"default": "Ctrl+Shift+9"
|
||||
},
|
||||
"description": "__MSG_commandGeneratePasswordDesc__"
|
||||
},
|
||||
"lock_vault": {
|
||||
"description": "__MSG_commandLockVaultDesc__"
|
||||
}
|
||||
},
|
||||
"web_accessible_resources": ["notification/bar.html", "images/icon38.png", "images/icon38_locked.png", "images/close.png"],
|
||||
"storage": {
|
||||
"managed_schema": "managed_schema.json"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
body{background-color:#fff;padding:0;margin:0;height:100%;font-size:14px;line-height:16px;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.outer-wrapper{padding:0 10px;border-bottom:2px solid #175ddc;display:grid;grid-template-columns:24px auto 55px;grid-column-gap:10px;box-sizing:border-box;min-height:42px}.inner-wrapper{display:grid;grid-template-columns:auto max-content}.outer-wrapper>*,.inner-wrapper>*{align-self:center}img{border:0;margin:0;padding:0}#logo{width:24px;height:24px;display:block}#close{width:15px;height:15px;display:block;padding:5px 0;margin-right:10px}button:not(.link),button:not(.neutral){background-color:#175ddc;padding:5px 15px;border-radius:3px;color:#fff;border:0}button:not(.link):hover,button:not(.neutral):hover{cursor:pointer;background-color:#1751bd}button.link,button.neutral{background:none;padding:5px 15px;color:#175ddc;border:0}button.link:hover,button.neutral:hover{cursor:pointer;background:none;text-decoration:underline}.select-folder[isVaultLocked=true]{display:none}@media screen and (max-width: 768px){.select-folder{display:none}}@media print{body{display:none}}
|
||||
@@ -0,0 +1 @@
|
||||
<!doctype html><html><head><title>Bitwarden</title><meta charset="utf-8"/><script defer="defer" src="../notification/bar.js"></script><link href="../notification/bar.css" rel="stylesheet"></head><body><div class="outer-wrapper"><div class="logo"><a href="https://vault.bitwarden.com" target="_blank" id="logo-link"><img id="logo" alt="Bitwarden"/></a></div><div id="content"></div><div><button type="button" class="neutral" id="close-button"><img id="close" alt="Close"/></button></div></div><div id="templates" style="display:none"><div class="inner-wrapper" id="template-add"><div class="add-text"></div><div class="add-buttons"><button type="button" class="never-save link"></button> <select class="select-folder" isvaultlocked="false"></select> <button type="button" class="add-save"></button></div></div><div class="inner-wrapper" id="template-change"><div class="change-text"></div><div class="change-buttons"><button type="button" class="change-save"></button></div></div></div></body></html>
|
||||
@@ -0,0 +1,206 @@
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 48626:
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||
(() => {
|
||||
// eslint-disable-next-line
|
||||
__webpack_require__(48626);
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
let i18n = {};
|
||||
let lang = window.navigator.language;
|
||||
i18n.appName = chrome.i18n.getMessage("appName");
|
||||
i18n.close = chrome.i18n.getMessage("close");
|
||||
i18n.never = chrome.i18n.getMessage("never");
|
||||
i18n.folder = chrome.i18n.getMessage("folder");
|
||||
i18n.notificationAddSave = chrome.i18n.getMessage("notificationAddSave");
|
||||
i18n.notificationAddDesc = chrome.i18n.getMessage("notificationAddDesc");
|
||||
i18n.notificationChangeSave = chrome.i18n.getMessage("notificationChangeSave");
|
||||
i18n.notificationChangeDesc = chrome.i18n.getMessage("notificationChangeDesc");
|
||||
lang = chrome.i18n.getUILanguage(); // eslint-disable-line
|
||||
// delay 50ms so that we get proper body dimensions
|
||||
|
||||
setTimeout(load, 50);
|
||||
|
||||
function load() {
|
||||
const isVaultLocked = getQueryVariable("isVaultLocked") == "true";
|
||||
document.getElementById("logo").src = isVaultLocked ? chrome.runtime.getURL("images/icon38_locked.png") : chrome.runtime.getURL("images/icon38.png");
|
||||
document.getElementById("logo-link").title = i18n.appName;
|
||||
var neverButton = document.querySelector("#template-add .never-save");
|
||||
neverButton.textContent = i18n.never;
|
||||
var selectFolder = document.querySelector("#template-add .select-folder");
|
||||
selectFolder.setAttribute("aria-label", i18n.folder);
|
||||
selectFolder.setAttribute("isVaultLocked", isVaultLocked.toString());
|
||||
var addButton = document.querySelector("#template-add .add-save");
|
||||
addButton.textContent = i18n.notificationAddSave;
|
||||
var changeButton = document.querySelector("#template-change .change-save");
|
||||
changeButton.textContent = i18n.notificationChangeSave;
|
||||
var closeIcon = document.getElementById("close");
|
||||
closeIcon.src = chrome.runtime.getURL("images/close.png");
|
||||
closeIcon.alt = i18n.close;
|
||||
var closeButton = document.getElementById("close-button");
|
||||
closeButton.title = i18n.close;
|
||||
closeButton.setAttribute("aria-label", i18n.close);
|
||||
document.querySelector("#template-add .add-text").textContent = i18n.notificationAddDesc;
|
||||
document.querySelector("#template-change .change-text").textContent = i18n.notificationChangeDesc;
|
||||
|
||||
if (getQueryVariable("add")) {
|
||||
setContent(document.getElementById("template-add"));
|
||||
var addButton = document.querySelector("#template-add-clone .add-save"),
|
||||
// eslint-disable-line
|
||||
neverButton = document.querySelector("#template-add-clone .never-save"); // eslint-disable-line
|
||||
|
||||
addButton.addEventListener("click", e => {
|
||||
e.preventDefault();
|
||||
const folderId = document.querySelector("#template-add-clone .select-folder").value;
|
||||
const bgAddSaveMessage = {
|
||||
command: "bgAddSave",
|
||||
folder: folderId
|
||||
};
|
||||
sendPlatformMessage(bgAddSaveMessage);
|
||||
});
|
||||
neverButton.addEventListener("click", e => {
|
||||
e.preventDefault();
|
||||
sendPlatformMessage({
|
||||
command: "bgNeverSave"
|
||||
});
|
||||
});
|
||||
|
||||
if (!isVaultLocked) {
|
||||
const responseFoldersCommand = "notificationBarGetFoldersList";
|
||||
chrome.runtime.onMessage.addListener(msg => {
|
||||
if (msg.command === responseFoldersCommand && msg.data) {
|
||||
fillSelectorWithFolders(msg.data.folders);
|
||||
}
|
||||
});
|
||||
sendPlatformMessage({
|
||||
command: "bgGetDataForTab",
|
||||
responseCommand: responseFoldersCommand
|
||||
});
|
||||
}
|
||||
} else if (getQueryVariable("change")) {
|
||||
setContent(document.getElementById("template-change"));
|
||||
var changeButton = document.querySelector("#template-change-clone .change-save"); // eslint-disable-line
|
||||
|
||||
changeButton.addEventListener("click", e => {
|
||||
e.preventDefault();
|
||||
const bgChangeSaveMessage = {
|
||||
command: "bgChangeSave"
|
||||
};
|
||||
sendPlatformMessage(bgChangeSaveMessage);
|
||||
});
|
||||
}
|
||||
|
||||
closeButton.addEventListener("click", e => {
|
||||
e.preventDefault();
|
||||
sendPlatformMessage({
|
||||
command: "bgCloseNotificationBar"
|
||||
});
|
||||
});
|
||||
window.addEventListener("resize", adjustHeight);
|
||||
adjustHeight();
|
||||
}
|
||||
|
||||
function getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split("=");
|
||||
|
||||
if (pair[0] === variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function setContent(element) {
|
||||
const content = document.getElementById("content");
|
||||
|
||||
while (content.firstChild) {
|
||||
content.removeChild(content.firstChild);
|
||||
}
|
||||
|
||||
var newElement = element.cloneNode(true);
|
||||
newElement.id = newElement.id + "-clone";
|
||||
content.appendChild(newElement);
|
||||
}
|
||||
|
||||
function sendPlatformMessage(msg) {
|
||||
chrome.runtime.sendMessage(msg);
|
||||
}
|
||||
|
||||
function fillSelectorWithFolders(folders) {
|
||||
const select = document.querySelector("#template-add-clone .select-folder");
|
||||
select.appendChild(new Option(chrome.i18n.getMessage("selectFolder"), null, true));
|
||||
folders.forEach(folder => {
|
||||
//Select "No Folder" (id=null) folder by default
|
||||
select.appendChild(new Option(folder.name, folder.id || "", false));
|
||||
});
|
||||
}
|
||||
|
||||
function adjustHeight() {
|
||||
sendPlatformMessage({
|
||||
command: "bgAdjustNotificationBar",
|
||||
data: {
|
||||
height: document.querySelector("body").scrollHeight
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
/******/ })()
|
||||
;
|
||||