简体   繁体   中英

Reenabling document.execCommand(“cut”) in Google Chrome

Is there a way to re-enable the document.execCommand("cut") Javascript method call in Google Chrome? Palm's WebOS Enyo framework uses this is a few places, which means when I'm working on applications locally I can't access every API of the framework.

Insight from all platforms welcome, but I'm working on OS X so those answers are preferred.

Chrome does not support execCommand or clipboard interaction, which is considered a security threat.

For example, Google docs on chrome shows a "Please use CTRL+X or use your browser's edit menu" dialog when a user tries to execute cut from google docs' UI.

An experimental clipboard API is available for chrome extensions : http://code.google.com/chrome/extensions/experimental.clipboard.html#method-executeCut

You are going to have to use the emulator for some functionality.

I dont know if other WebKit browsers like Safari have this ability enabled however.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM