*有关更好的理解,请参阅此屏幕:* https://ibb.co/982MWGB
我想从我的剪贴板(我通过chrome扩展中的document.execCommand('copy')复制的)复制的HTML格式的内容粘贴到我的浏览器窗口上,它可以是浏览器上任何活动的标签,它应该粘贴在我点击鼠标的任何输入/文本区域/丰富编辑器中。
问题:我无法将控件提供给活动选项卡,也无法在单击时粘贴复制的HTML格式的内容。
在我的例子中,我做了一个chrome扩展,我有一个用户列表,所以当我点击每个用户时,我会得到使用document.execCommand(‘copy’)复制到剪贴板中的HTML格式的内容(而不是字符串);我想把它粘贴到我点击鼠标的任何输入/文本区域/丰富编辑器中。
Manifest.json looks like
{
"manifest_version": 2,
"name": "ChromeExtension",
"version": "1.0",
"permissions": [
"http://*/",
"https://*/",
"http://localhost/",
"http://localhost/chromeextension/",
"downloads",
"activeTab",
"declarativeContent",
"storage",
"tabs",
"webNavigation",
"notifications"
],
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"]
}],
"content_scripts": [ {
"matches": ["*://*/*"],
"js": ["jquery.js", "quilljs.js", "popup.js"]
}],
"browser_action": {
"default_icon": "icon.png",
"default_title": "Custom Marketing Extension",
"default_popup": "popup.html"
},
"background": {
"scripts": ["background.js"],
"persistent": true
},
"icons": {
"16": "icon.png",
"32": "icon.png",
"48": "icon.png",
"128": "icon.png"
}
}我希望能够在浏览器窗口的活动选项卡中粘贴复制的内容。
发布于 2019-09-04 00:30:51
其他人也可以跨多个选项卡使用localsotrage。请参阅:browser sessionStorage. share between tabs?
https://stackoverflow.com/questions/57768625
复制相似问题