dcsimg
www.webdeveloper.com
Results 1 to 11 of 11

Thread: Open window under or tab-under in chrome

  1. #1
    Join Date
    Jan 2017
    Posts
    11

    Unhappy Open window under or tab-under in chrome

    Hello
    please guide me what functions should add to below code for open window in under browser or Tab-under in google chrome ..
    it seems current code doesn't works for chrome

    Code:
    scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0";var need_open = true

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,425
    What code? You have a list of parameters and no code that you are using.

    Code:
    	window.open("about:blank","_blank");
    is whats likely needed and its not always going to work because of people and their preferences for blocking pop up windows...

    Generally people don't appreciate windows being opened up as popups or unders...
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  3. #3
    Join Date
    Jan 2017
    Posts
    11
    I want it opens window under main browser not infront

  4. #4
    Join Date
    Jan 2017
    Posts
    11
    Code:
    if (navigator.cookieEnabled)
      {var pop_under = null;var pop_cookie_name = "<?php print md5($cfgURL); ?>";var pop_timeout = 10;function pop_cookie_enabled(){var is_enabled = false;if (!window.opera && !navigator.cookieEnabled)return is_enabled;if (typeof document.cookie == 'string')if (document.cookie.length == 0){document.cookie = "test";is_enabled = document.cookie == 'test';document.cookie = '';}
    else{is_enabled = true;}return is_enabled;}function pop_getCookie(name){var cookie = " " + document.cookie;var search = " " + name + "=";var setStr = null;var offset = 0;var end = 0;if (cookie.length > 0){offset = cookie.indexOf(search);if (offset != -1){offset += search.length;end = cookie.indexOf(";", offset);if (end == -1){end = cookie.length;}
    setStr = unescape(cookie.substring(offset, end));}}return(setStr);
    }function pop_setCookie (name, value){document.cookie = name + "=" + escape(value) + "; expires=Friday,31-Dec-50 23:59:59 GMT; path=/;";
    }function show_pop(){var pop_wnd = 'ht'+'tp'+':'+'/'+'/<?php print $cfgURL; ?>'+'/c'+'lic'+'k/bo'+'dy.php?id=<?php print intval($_GET['id']); ?>&hash=<?php print $hash; ?>';var fea_wnd = "scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0";var need_open = true;if (document.onclick_copy != null)document.onclick_copy();if (document.body.onbeforeunload_copy != null)document.body.onbeforeunload_copy();if (pop_under != null){if (!pop_under.closed)need_open = false;}if (need_open){if (pop_cookie_enabled()){val = pop_getCookie(pop_cookie_name);if (val != null){now = new Date();val2 = new Date(val);
    utc1 = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
    utc2 = Date.UTC(val2.getFullYear(), val2.getMonth(), val2.getDate(), val2.getHours(), val2.getMinutes(), val2.getSeconds());
    if ((utc1 - utc2)/1000 < pop_timeout*60)
    {need_open = false;}}}}if (need_open){under = window.open(pop_wnd, "", fea_wnd);under.blur();window.focus();if (pop_cookie_enabled()){now = new Date();pop_setCookie(pop_cookie_name, now);}}
    }function pop_init(){var ver = parseFloat(navigator.appVersion);var ver2 = (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )&&(navigator.userAgent.indexOf('Opera') == -1)&&(navigator.appName != 'Netscape') &&(navigator.userAgent.indexOf('MSIE') > -1) &&(navigator.userAgent.indexOf('SV1') > -1) &&(ver >= 4);
    if (ver2){if (document.links){for (var i=0; i<document.links.length; i++){if (document.links[i].target != "_blank"){document.links[i].onclick_copy = document.links[i].onclick;document.links[i].onclick = show_pop;}}}}document.onclick_copy = document.onclick;document.onmouseup = show_pop;}pop_init();}

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,425
    You are missing the point, it is down to the user and their browser settings that will most likely determine how a window opens if allowed at all.

    FYI about cookies, they are now dead tech, use localStorage objects to store your cookie information in as well as that, you have to advise that you use cookies for a large number of countries these days, so using localStorage negates that need for you to declare your using cookies.

    Cookies are not a good medium because anyone can access the cookie string data from another site webpage, they are in no way secure and pose issues with privacy, which is why you have to declare their use.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  6. #6
    Join Date
    Jan 2017
    Posts
    11
    This Js is a plugin in a network
    if you can fix this file for me and have a good skills , I can pay you for fix it and we can talk about features

  7. #7
    Join Date
    Oct 2013
    Location
    Sheboygan, Wisconsin
    Posts
    1,612
    Any pop up, under are anything like that and I am gone, never to return.
    Lot of us like that.

  8. #8
    Join Date
    Jan 2017
    Posts
    11
    Quote Originally Posted by Train View Post
    Any pop up, under are anything like that and I am gone, never to return.
    Lot of us like that.
    Sorry i didn't understand your language but if you mean you don't like popunders , You shall know im not interesting to talk about your Favorites . I'm here for a business and offer job to someone does it

  9. #9
    Join Date
    Aug 2016
    Posts
    113
    change ...

    if (navigator.cookieEnabled){
    var pop_under = null;
    var pop_cookie_name = "<?php print md5($cfgURL); ?>";

    to ...
    if (navigator.cookieEnabled){
    var pop_under = true;
    var pop_cookie_name = "<?php print md5($cfgURL); ?>";

  10. #10
    Join Date
    Jan 2017
    Posts
    11
    Quote Originally Posted by shakazorba View Post
    change ...

    if (navigator.cookieEnabled){
    var pop_under = null;
    var pop_cookie_name = "<?php print md5($cfgURL); ?>";

    to ...
    if (navigator.cookieEnabled){
    var pop_under = true;
    var pop_cookie_name = "<?php print md5($cfgURL); ?>";
    It didnt works

  11. #11
    Join Date
    Oct 2013
    Location
    Sheboygan, Wisconsin
    Posts
    1,612
    Quote Originally Posted by billm View Post
    Sorry i didn't understand your language but if you mean you don't like popunders , You shall know im not interesting to talk about your Favorites . I'm here for a business and offer job to someone does it
    Yes, it is a preference , but would hate to see you lose possible customers because it was added.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center