开发者

Take screenshots on focus change

开发者 https://www.devze.com 2023-03-20 09:32 出处:网络
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 screenshot

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. Un开发者_如何学JAVAfortunately 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);
});
});
};


http://www.devguru.com/technologies/ecmascript/quickref/evhan_onblur.html

Code:
Enter email address <INPUT TYPE="text" VALUE="" NAME="userEmail" onBlur=addCheck()>

<script type="text/javascript" language="JavaScript">

function addCheck() {
 alert("Please check your email details are correct before submitting")
}

</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消