Problem with java script - customizing Oxygen Web author !
Posted: Wed Nov 25, 2020 6:06 pm
Hi team,
We are using Oxygen Xml Web Author 20.1.1 and doing some customization. We are implementing a new feature in the Author mode which needs to read clipboard content and store in a variable using javascript. We tried different approaches but its failing for few browsers because of vulnerability issue.
1.) Compatible with MSIE browser but not working in others:
window.clipboardData.getData('Text');
2.) Compatible with Chrome and Edge( version 87.0 ) but not working in others:
navigator.clipboard.readText().then(text => {
console.log('Pasted content: ', text);
})
.catch(err => {
console.error('Failed to read clipboard contents: ', err);
});
3.) Compatible with Chrome and Edge( Version 44+ ) but not working in others:
document.addEventListener("paste", function(){
var clipText = event.clipboardData.getData('Text');
});
Could you please suggest any solution regarding this which can support all the browsers.
Regards,
Shabeer
We are using Oxygen Xml Web Author 20.1.1 and doing some customization. We are implementing a new feature in the Author mode which needs to read clipboard content and store in a variable using javascript. We tried different approaches but its failing for few browsers because of vulnerability issue.
1.) Compatible with MSIE browser but not working in others:
window.clipboardData.getData('Text');
2.) Compatible with Chrome and Edge( version 87.0 ) but not working in others:
navigator.clipboard.readText().then(text => {
console.log('Pasted content: ', text);
})
.catch(err => {
console.error('Failed to read clipboard contents: ', err);
});
3.) Compatible with Chrome and Edge( Version 44+ ) but not working in others:
document.addEventListener("paste", function(){
var clipText = event.clipboardData.getData('Text');
});
Could you please suggest any solution regarding this which can support all the browsers.
Regards,
Shabeer