클립 보드의 내용을 읽을 수있는 Google 크롬 확장 프로그램을 만들고 있습니다.
그러나 이에 대한 설명서를 얻을 수 없습니다. IE의 클립 보드 API에서와 같이 클립 보드 내용을 가져오고 싶습니다. 매니페스트 파일에서
내가 내가내 확장 기능에서 document.execCommand ('paste')가 작동하지 않는 이유
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if (request.method == "getClipData")
sendResponse({data: document.execCommand('paste')});
else
sendResponse({}); // snub them.
});
아래와 같은 배경 페이지에서 함수를 만든 및 컨텐트 스크립트에서 나는이
chrome.extension.sendRequest({method: "getClipData"}, function(response) {
alert(response.data);
});
같은 함수를 호출하고
clipboardRead and clipboardWrite.
권한을 준
하지만이 값은 정의되지 않았습니다 ...
[Google 크롬 확장에서 클립 보드 텍스트를 읽는 방법] (http : /stackoverflow.com/questions/8509670/how-to-read-the-clipboard-text-in-google-chrome-extension) –