将数据从DOM传递到本机消息传递API(Pass data from DOM to native messaging API)
我正在开发一个Chrome扩展程序,它通过Chrome的本机消息传递API将当前标签的URL发送到后台脚本。 这将启动一个外部脚本,该脚本运行youtube-dl以提取视频URL并将其传递给在该平台上具有硬件加速的播放器。 这有效,代码在这里: https : //github.com/mad-ady/odroid.c2.video.helper 。
我想通过以下方式改进它:
- 在每个视频元素之后在DOM中注入新按钮
- 按下按钮,提取视频元素的src URL,并通过消息传递API将其传递给后端进行播放
我的问题是“这是允许/可能的”吗?
当我在页面的范围内时,如何调用后台定义的函数?I'm working on a chrome extension that sends the URL of the current tab to a background script via Chrome's native messaging API. This starts an external script which runs youtube-dl to extract the video url and pass it to a player that has hardware acceleration on that platform. This works and the code is here: https://github.com/mad-ady/odroid.c2.video.helper.
I'd like to improve it with the following:
- inject new buttons in the DOM after each video element
- on button press extract the video element's src URL and pass it via the messaging API to the backend for playback
My question is "is this allowed/possible"?
How can I call a function defined in background when I'm in the page's scope?
原文:https://stackoverflow.com/questions/39933888
最满意答案
作为根,试试
chmod -R +rx /opt/eclipse chmod -R 777 /opt/eclipse/configuration/org.eclipse.osgi/.manager
如果这不起作用,请尝试删除.manager,然后重复
as root, try
chmod -R +rx /opt/eclipse chmod -R 777 /opt/eclipse/configuration/org.eclipse.osgi/.manager
If that doesn't work, try removing, the .manager, and repeat
相关问答
更多-
如果您未为Java EE开发人员安装Eclipse IDE包,则必须确保安装插件“JST服务器适配器扩展”。 为此,请转至帮助 - >安装新软件...并选择“开普勒”存储库 。 然后展开“Web,XML,Java EE和OSGi企业开发”并选中“JST服务器适配器扩展”复选框。 点击“完成”,接受,安装并重新启动。 现在,您应该可以像以前一样添加新的服务器。 If you did not install the package Eclipse IDE for Java EE Developers so yo ...
-
转到首选项下,然后在提供的搜索框中键入“ workspace ”以过滤列表。 或者,您可以转到常规>启动和关闭>工作区 。 在那里,您可以设置一个标志,通过选中“ 启动时提示工作区 ”复选框,使Eclipse提示您在启动时选择工作区 。 您还可以设置要记住的先前工作空间的数量。 最后有一个最近的工作区列表。 如果您只是删除了除Eclipse之外的所有Eclipse,Eclipse将自动启动该工作区。 Go under preferences then type "workspace" in the sear ...
-
安装e(fx)clipse时出现的问题在Eclipse Kepler中(Problems in Installing e(fx)clipse In Eclipse Kepler)[2021-10-05]
问题是xtext是e(fx)clipse的要求 - 我建议立即开始从http://efxclipse.bestsolution.at/install.html下载预先打包的发行版。 我明天会自己试一试,看看哪些是失败的。 我还将预先打包的发行版更新为4.3.2,以便获得最新的位。 The problem is xtext which is a requirement for e(fx)clipse - I'd suggest to get started right away to download a p ... -
事实证明,当我通过Eclipse的新项目界面创建项目时,我没有指定Linux GCC(我正在使用Ubuntu)作为我的工具链。 当我将其指定为编译器时,项目是使用我正在寻找的所有包含。 希望这有助于其他人。 It turns out that the problem here was that I wasn't specifying Linux GCC (I'm using Ubuntu) as my toolchain when I created the project through Eclipse' ...
-
每个eclipse版本都有一些错误修复,新功能更新API等。 您可以查看每个版本的新闻和值得注意的部分,以了解当前版本与其先前版本的不同之处。 开普勒新闻和值得注意的部分就在这里 。 从这里和这里比较Juno和Kepler的每个功能/涉及项目版本。 请注意,Kepler功能版本更高(或更新),表示新修复版本中的错误修复或新功能。 有关详细的差异,请检查eclipse bugzilla中分配给每个功能的较新版本的所有错误或问题 编辑于2014年10月9日星期四12:14:17 IST 2014 好消息。 现在 ...
-
如果你不在代理或防火墙后面,它可能是Java 7的一个问题。在Java 6上运行你的eclipse可能会修复它,更多细节在这里: 无法安装新软件/检查更新eclipse If you're not behind a proxy or firewall it might be an issue with Java 7. Running your eclipse on Java 6 might fix it, more details here: Unable to install new software/c ...
-
添加与此类似的东西给你的pom。 您可能需要调整插件版本。
[...] [...] org.apache.maven.plugins maven-compiler-plugin 作为根,试试 chmod -R +rx /opt/eclipse chmod -R 777 /opt/eclipse/configuration/org.eclipse.osgi/.manager 如果这不起作用,请尝试删除.manager,然后重复 as root, try chmod -R +rx /opt/eclipse chmod -R 777 /opt/eclipse/configuration/org.eclipse.osgi/.manager If that doesn't w ...我知道了,无知就是这样,因为我之前从未做过任何SWT。 所以这个回复是针对所有那些像我一样无知的人。 代表SWT库的jar文件位于eclipse安装的plugin文件夹中,用于将jar文件添加到项目中,您必须按照以下步骤操作: 右键单击项目名称 选择属性 从显示的对话框中选择Java Build Path 选择Libraries>点击Add External JARs ... 从org.eclipse.swt.windowing_system> _表示的eclipse文件夹中的plugins文件夹中选择SW ...通过删除.metadata文件夹解决了这个问题,迫使eclipse创建了一个新文件夹。 现在很棒。 Solved this issue by deleting the .metadata folder, forcing eclipse to create a fresh one. Works great now.相关文章
更多- Storm-源码分析- Messaging (backtype.storm.messaging)
- Spring Data: a new perspective of data operations
- 哪位高手能帮忙看下dom4j添加复杂节点--紧急
- Spring Data Solr教程(翻译)
- Becoming a data scientist
- java API 操作 Zookeeper
- data-config
- (二)solr data import
- extjs 3.1 Ext.TabPanel dom为空或不是对象
- 《Big Data Glossary》笔记
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。