English 中文(简体)
在浏览器的延伸中,我如何点击警报的具体纽扣?
原标题:In a browser extension, how do I click a specific button of an alert?

因此

我需要自动点击<条码>。

固定导航: [打破本页] [上页]

援引这一点的法典是

$(window).bind( beforeunload , function() {
  return  Leave page? ;
  //Click prompt code goes here.
  $(window).unbind();
});

If I take away return Leave page? ; then the iframed page overrides the top frame and the user is struck with an unknown site, maybe there s another way to do this?

问题回答

实际情况见<代码>onload。 活动:

$(window).bind( beforeunload , function() {
      return  Leave page? ;
});

不是自动点击,而是检查你是否能够自动卸下<代码>window.on beforeunload。 这比试图在模式窗口的路口把点击到特定纽顿最容易。

I agree with Thiefmaster. Alternative is to replace the alert, prompt or confirm if that is what is used:

window.confirm=function() {
  // here you do what you want
}




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签