最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Javascript Method to Ensure Open in New Window (not Tab) - Stack Overflow

programmeradmin5浏览0评论

Bear with me as this might seem similar to ( JavaScript open in a new window, not tab), but the method by which the link is executed is different. I am opening a "Sales Script" application via a third party application when a soft phone is answered. If the sales rep already has a browser window open (and they always do), a new tab is opened within the existing window and it isn't always readily noticeable. They are requesting that I always have my application pop a new window, but as near as I can tell the only way to do this is via the browser's preferences. Is there by any chance some javascript I am not aware of that will "undock" a tab? I suspect the answer is no, but had to ask.

Thanks for your time!

[EDIT] I thought maybe this was out of scope of the question initially, but I think it could shed light on what I am trying to do: A 3rd party app (iSymphony) runs on the local machine and listens to events on our call controller. When the rep answers, it fires a URL, which is opened in the system's default browser. I don't really have any control over how it's opened, which is why I was hoping for a javascript solution to ensure I was in a new window.

Bear with me as this might seem similar to ( JavaScript open in a new window, not tab), but the method by which the link is executed is different. I am opening a "Sales Script" application via a third party application when a soft phone is answered. If the sales rep already has a browser window open (and they always do), a new tab is opened within the existing window and it isn't always readily noticeable. They are requesting that I always have my application pop a new window, but as near as I can tell the only way to do this is via the browser's preferences. Is there by any chance some javascript I am not aware of that will "undock" a tab? I suspect the answer is no, but had to ask.

Thanks for your time!

[EDIT] I thought maybe this was out of scope of the question initially, but I think it could shed light on what I am trying to do: A 3rd party app (iSymphony) runs on the local machine and listens to events on our call controller. When the rep answers, it fires a URL, which is opened in the system's default browser. I don't really have any control over how it's opened, which is why I was hoping for a javascript solution to ensure I was in a new window.

Share Improve this question edited May 23, 2017 at 12:34 CommunityBot 11 silver badge asked Nov 29, 2012 at 23:16 Jesse QJesse Q 1,6713 gold badges14 silver badges21 bronze badges 1
  • You're saying the sales person clicks on a link in a third party app, and that link is opened in a new tab in their existing browser? Yea, that's an IE setting (Called like Use Existing Browser for links or something).. – Mike Christensen Commented Nov 29, 2012 at 23:23
Add a ment  | 

1 Answer 1

Reset to default 12

If you specify the width and height when you call window.open, most browsers will open the link in a new window rather than a tab.

window.open(url, '_blank', 'width=300,height=200');

Fiddle: http://jsfiddle/kelervin/Pf8Rw/

See this question for discussion and more detail.

If the intent is to get the user's attention, you could consider adding desktop notifications (assuming a browser like Chrome that supports them is an option).

See this answer for an example, it might be just what you're looking for.

发布评论

评论列表(0)

  1. 暂无评论