焦点变化时截图
我正在开发一个 chrome 扩展,我遇到的情况是有两个输入字段(文本框)。一旦焦点从第一个文本框更改为第二个文本框,我想在发生鼠标单击事件时开始截屏。
我的第一个问题是,每当焦点发生变化时,如何收到警报?
这是我用于截取屏幕截图的内容脚本,我将把它注入到网站中。不幸的是,它目前不起作用。
内容脚本.js
document.onclick=function() {
{
chrome.windows.getCurrent(function(win){
chrome.tabs.captureVisibleTab(win.id, function(imgUrl) {
var screenshotUrl = imgUrl;
console.log(screenshotUrl);
});
});
};
I am developing a chrome extension and I have a situation where I have two input fields(textbox). Once the focus changes from the first textbox to the second textbox, I want to start taking screenshots whenever a mouse-click event occurs.
My first question is how do I get alerted whenever focus change takes place ?
This is my content script for taking screenshots which I am going to inject into a website. Unfortunately it's not working at the moment.
content_script.js
document.onclick=function() {
{
chrome.windows.getCurrent(function(win){
chrome.tabs.captureVisibleTab(win.id, function(imgUrl) {
var screenshotUrl = imgUrl;
console.log(screenshotUrl);
});
});
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.devguru.com/technologies/ecmascript/quickref/evhan_onblur.html
http://www.devguru.com/technologies/ecmascript/quickref/evhan_onblur.html