Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aecreations/clippings int…
Browse files Browse the repository at this point in the history
…o branches/6.2

- Pulling in PR for fix for issue #320 into 6.2.x branch
  • Loading branch information
aecreations committed Feb 18, 2021
2 parents 955c064 + a294772 commit 8e4951b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions wx-src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function handleRequestNewClipping(aRequest)
return rv;
}

let activeElt = window.document.activeElement;
let activeElt = getActiveElt();

log("Clippings/wx::content.js: handleRequestNewClipping(): activeElt = " + (activeElt ? activeElt.toString() : "???"));

Expand Down Expand Up @@ -105,7 +105,7 @@ function handleRequestInsertClipping(aRequest)
let clippingText = aRequest.content;
let htmlPaste = aRequest.htmlPaste;
let autoLineBrk = aRequest.autoLineBreak;
let activeElt = window.document.activeElement;
let activeElt = getActiveElt();

log("Clippings/wx::content.js: handleRequestInsertClipping(): activeElt = " + (activeElt ? activeElt.toString() : "???"));

Expand Down Expand Up @@ -242,6 +242,16 @@ function isGoogleChrome()
return rv;
}

function getActiveElt() {
let activeElt = window.document.activeElement;

if (!!activeElt && !!activeElt.shadowRoot) {
activeElt = activeElt.shadowRoot.activeElement;
}

return activeElt;
}


function init()
{
Expand Down

0 comments on commit 8e4951b

Please sign in to comment.