On sites with iFrames I have difficulties retrieving the selected text if I take a detour via a context-menu content-script.
In main.js I define a context-menu-item with a SelectionContext, in its onMessage-method a page-mod contentScriptFile is informed. This script is then supposed to get the selection via getSelection().toString().
But when being inside an iFrame this method either returns an empty string or getSelection is null. Trying to get the selection via parent window (parent.getSelection()) results in an error (probably due to Same-Origin-Policy):
console.error: Message: Error:
Permission denied to access property “getSelection”
Anyone any idea how to solve this issue? Thanx