0

At the top of my HTML page, I have declared the path to my Google Chrome extension:

<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/thekey">

Further down, I inspect of the app is installed, and, if it is, execute a copy command (or paste, or cut):

if (chrome.app.isInstalled) {
     document.execCommand("copy");
}

I am trying to serve this page locally, and the URL in the address bar points to localhost. However, none of the clipboard features work. My app currently has the correct clipboardRead and clipboardWrite permissions, and of course the app is installed, but I think it's not executing because my localhost is not pointing to the site listed in "app":"urls".

Is there any way that I can test locally if cut/copy/paste is working correctly through my extension?

4

1 回答 1

0

如果您正在测试"apps" : "urls"列表中未列出的域,则该域自然不存在您的权限。您不能只添加http://localhost/为应用 URL 吗?我知道 Chrome 网上应用店不允许这样做,但无论如何你都应该在完成测试后将其删除。

于 2012-06-01T19:41:37.000 回答