Open
Bug 1695659
Opened 4 years ago
Updated 3 years ago
Inconsistent document.execCommand('paste') behaviour in tabs with iframes
Categories
(WebExtensions :: General, defect, P3)
WebExtensions
General
Tracking
(Not tracked)
NEW
People
(Reporter: eros_uk, Unassigned, NeedInfo)
Details
Attachments
(1 file)
804 bytes,
application/zip
|
Details |
Firefox 88.0a1 (2021-03-01) (64-bit) Win7
Info
- activeTab permission
- paste into
textarea
,input
andcontenteditable
- Pasting from clipboard into above on context-menu onclick
- same origin
file:///C:/Users/....
in test - using
tabs.executeScript()
to inject - Injection into all applicable frames are confirmed
- there are no errors
document.execCommand('paste')
returnstrue
when works and returnsfalse
when it fails
Testing on 2 HTML pages
- An HTML page with
input
,textarea
&contenteditable
elements - As above plus an
iframe
that also hasinput
,textarea
&contenteditable
elements
Also tested on random web pages.
allFrames: false
const code = `(() => document.execCommand('paste'))();`;
chrome.tabs.executeScript({code}, (result = []) => {
console.log(result);
});
Result
- tab with 1 frame: ✅ paste works in top-frame
// Array [ true ]
- tab with 1+ frames: ❌ paste fails in top-frame
// Array [ false ]
- tab with 1+ frames: ❌ paste fails in sub-frame
// Array [ false ]
allFrames: true
const code = `(() => document.execCommand('paste'))();`;
chrome.tabs.executeScript({code, allFrames: true}, (result = []) => {
console.log(result);
});
Result
- tab with 1 frame: ✅ paste works in top-frame
// Array [ true ]
- tab with 1+ frames: ❌ paste fails in top-frame
// Array [ false, true ]
- tab with 1+ frames: ✅ paste works in sub-frame
// Array [ false, true ]
Result Summary
The behaviour of document.execCommand('paste')
appears to be inconsistent when there are more than one frames in a tab.
Bug 1695659 minimal test extension
Comment 2•4 years ago
|
||
Does this happen with an extension only or is there some testcase showing the issue also in web pages?
Flags: needinfo?(eros_uk)
I am not sure how to test it in a web page and into top-frame as well as sub-frames and trigger it from a user-action while keeping the document.activeElement
the target of the paste.
Flags: needinfo?(eros_uk)
Updated•4 years ago
|
Component: DOM: Editor → General
Product: Core → WebExtensions
Updated•4 years ago
|
Severity: -- → S4
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•