@@ -130,7 +130,6 @@ export function showHidePassword(event) {
130130export async function copyInput ( event ) {
131131 console . debug ( 'copyInput:' , event )
132132 const el = event . currentTarget || event . target . closest ( 'button' )
133- console . debug ( 'el.dataset.copyInput:' , el . dataset . copyInput )
134133 const input = document . querySelector ( el . dataset . copyInput )
135134 console . debug ( 'input:' , input )
136135 if ( ! input . value ) {
@@ -180,8 +179,11 @@ export async function saveOptions(event) {
180179 } else {
181180 value = event . target . value
182181 }
182+
183183 if ( value === undefined ) {
184- console . warn ( `No Value for key: ${ key } ` )
184+ console . warn ( `No value for key: ${ key } ` )
185+ } else if ( value === options [ key ] ) {
186+ console . log ( `No value change for key: ${ key } :` , value )
185187 } else {
186188 options [ key ] = value
187189 console . log ( `Set %c${ key } :` , 'color: Khaki' , value )
@@ -222,7 +224,6 @@ export function updateOptions(options) {
222224 hideShowElement ( `#${ el . dataset . related } ` , value )
223225 }
224226 if ( el . dataset . warning ) {
225- // addWarningClass(el.nextElementSibling, value, el.dataset.warning)
226227 el . nextElementSibling . classList . toggle ( el . dataset . warning , ! ! value )
227228 }
228229 }
@@ -245,27 +246,11 @@ function hideShowElement(selector, show, speed = 'fast') {
245246 }
246247}
247248
248- // /**
249- // * Add Warning Class to Element
250- // * @function addWarningClass
251- // * @param {HTMLElement } element
252- // * @param {Boolean } value
253- // * @param {String } warning
254- // */
255- // function addWarningClass(element, value, warning) {
256- // // console.debug('addWarningClass:', value, element)
257- // if (value) {
258- // element.classList.add(warning)
259- // } else {
260- // element.classList.remove(warning)
261- // }
262- // }
263-
264249/**
265250 * Link Click Callback
266251 * Note: Firefox popup requires a call to window.close()
267252 * @function linkClick
268- * @param {MouseEvent } event
253+ * @param {Event| MouseEvent } event
269254 * @param {Boolean } [close]
270255 */
271256export async function linkClick ( event , close = false ) {
@@ -402,10 +387,10 @@ export async function checkPerms() {
402387 origins : [ '*://*/*' ] ,
403388 } )
404389 console . debug ( 'checkPerms:' , hasPerms )
390+
405391 // Firefox still uses DOM Based Background Scripts
406- if ( typeof document === 'undefined' ) {
407- return hasPerms
408- }
392+ if ( typeof document === 'undefined' ) return hasPerms
393+
409394 const hasPermsEl = document . querySelectorAll ( '.has-perms' )
410395 const grantPermsEl = document . querySelectorAll ( '.grant-perms' )
411396 if ( hasPerms ) {
@@ -421,16 +406,14 @@ export async function checkPerms() {
421406/**
422407 * Grant Permissions Click Callback
423408 * @function grantPerms
424- * @param {MouseEvent } event
409+ * @param {Event } event
425410 * @param {Boolean } [close]
426411 */
427412export async function grantPerms ( event , close = false ) {
428413 console . debug ( 'grantPerms:' , event )
429414 // noinspection ES6MissingAwait
430415 requestPerms ( )
431- if ( close ) {
432- window . close ( )
433- }
416+ if ( close ) window . close ( )
434417}
435418
436419/**
0 commit comments