wsv01 Posted September 25, 2018 Share Posted September 25, 2018 I'm still trying to figure out why uniGUI is trying to close the browser window on startup. I had time to run my application on three different browser. IE11, Edge and Chrome. On IE11 and Edge, a window appears With this message The site you're on is trying to close this window. Do you want to close this window? "Yes" or "No" buttons. IF I click Yes, the browser closes and if I click No, the application appears and runs as normal. I launched Chrome and ran debugging and found that the <script>...</script> after the header actually had a window.close() command. It looked like this: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Vendor Requistion</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=10.0, user-scalable=yes"> <meta http-equiv="content-type" content="charset=utf-8"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="expires" content="-1"> <link REL="SHORTCUT ICON" HREF="/cache/nas_vendreg_exe/87bL9D5OmE1027EDAB5/favicon.ico"> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-ext.css" /> <link rel=stylesheet href="/ext-6.5.3/build/classic/theme-classic/resources/theme-classic-all.css" /> <script src="/ext-6.5.3/build/ext-all.js"></script> <script src="/ext-6.5.3/build/classic/theme-classic/theme-classic.js"></script> <script src="/uni-1.50.0.1480/ext-unicommon-min.js"></script> <script src="/uni-1.50.0.1480/ext-sync-min.js"></script> <script src="/uni-1.50.0.1480/jQuery/jquery-1.11.2.min.js"></script> <link rel=stylesheet href="/ext-6.5.3/build/packages/font-awesome/resources/font-awesome-all.css" /> <link rel=stylesheet href="/ext-6.5.3/build/packages/font-pictos/resources/font-pictos-all.css" /> <script src="/uni-1.50.0.1480/jQuery/MaskedInput/jquery.inputmask.min.js"></script> <script src="/uni-1.50.0.1480/jQuery/autoNumeric/autoNumeric-1.9.35.js"></script> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-xtheme-common.css" /> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-xtheme-classic.css" /> <script src="/uni-1.50.0.1480/ext-unigui-min.js"></script> <style type="text/css">.x-viewport > .x-body {position:relative !important;}</style> <style type="text/css">body {overflow-y: hidden !important;}</style> </head> <script> window.close();;uniVars._extVer="6.5.3";_S_ID="_S_ID=87bL9D5OmE1027EDAB5";Ext.Ajax.setTimeout(1800000);uniSyncObj.errShow=true;uniSyncObj.errText="Connection Error";uniSyncObj.errRetryText="Retrying...";uniSyncObj.errTextColor="#0055AA";uniSyncObj.errAfterRetry=1;uniSyncObj.errLogTry=0x7ef4f2fa;uniSyncObj.licOwn="@@@@@@@@@@@@=";uniSyncObj.srcArr="XJoHutVO"; ... </script> <body> <div id="loading-mask"></div><div id="loading"><div class="loading-indicator">Loading...</div></div> <div id=body></div><noscript>This web application requires JavaScript enabled</noscript></body> </html> The debug text continues, but the rest is not causing issues. I then created a simple uniGUI standalone application with nothing but a button on the main form that ran showmessage('ok'). This time, looking at the debugger I got this: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>New Application</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=10.0, user-scalable=yes"> <meta http-equiv="content-type" content="charset=utf-8"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="expires" content="-1"> <link REL="SHORTCUT ICON" HREF="/cache/project1_exe/APLNDGAwn81027EE02C/favicon.ico"> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-ext.css" /> <link rel=stylesheet href="/ext-6.5.3/build/classic/theme-classic/resources/theme-classic-all.css" /> <script src="/ext-6.5.3/build/ext-all.js"></script> <script src="/ext-6.5.3/build/classic/theme-classic/theme-classic.js"></script> <script src="/uni-1.50.0.1480/ext-unicommon-min.js"></script> <script src="/uni-1.50.0.1480/ext-sync-min.js"></script> <script src="/uni-1.50.0.1480/jQuery/jquery-1.11.2.min.js"></script> <link rel=stylesheet href="/ext-6.5.3/build/packages/font-awesome/resources/font-awesome-all.css" /> <link rel=stylesheet href="/ext-6.5.3/build/packages/font-pictos/resources/font-pictos-all.css" /> <script src="/uni-1.50.0.1480/jQuery/MaskedInput/jquery.inputmask.min.js"></script> <script src="/uni-1.50.0.1480/jQuery/autoNumeric/autoNumeric-1.9.35.js"></script> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-xtheme-common.css" /> <link rel=stylesheet href="/uni-1.50.0.1480/css/uni-xtheme-classic.css" /> <script src="/uni-1.50.0.1480/ext-unigui-min.js"></script> <style type="text/css">.x-viewport > .x-body {position:relative !important;}</style> <style type="text/css">body {overflow-y: hidden !important;}</style> </head> <script> uniVars._extVer="6.5.3";_S_ID="_S_ID=APLNDGAwn81027EE02C";uniSyncObj.errShow=true;uniSyncObj.errText="Connection Error";uniSyncObj.errRetryText="Retrying...";uniSyncObj.errTextColor="#0055AA";uniSyncObj.errAfterRetry=1;uniSyncObj.errLogTry=0x7ef4f2fa;uniSyncObj.licOwn="@@@@@@@@@@@@=";uniSyncObj.srcArr="XJoHutVO"; ... </script> <body> <div id="loading-mask"></div><div id="loading"><div class="loading-indicator">Loading...</div></div> <div id=body></div><noscript>This web application requires JavaScript enabled</noscript></body> </html> Notice that there is no window.close() at the beginning of the script. I've tried stepping through the application and cannot find out where this window.close() is being executed from. Any help would be greatly welcome. Note: I don't know if the licOwn= value is something private to my license, so I just replaced it with @@@@@@@@@@@@ Quote Link to comment Share on other sites More sharing options...
wsv01 Posted September 25, 2018 Author Share Posted September 25, 2018 OK, after several days of trying to figure this out, I finally viewed my main form as text and there it was staring me in the face!!!!! Script.Strings = ( 'window.close();') I cannot for the life of me know why I placed that into the Java Script property on the main form, but as you can imagine, when it was removed, the application ran without the message appearing. I'll never forget this one! Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 25, 2018 Administrators Share Posted September 25, 2018 4 minutes ago, wsv01 said: OK, after several days of trying to figure this out, I finally viewed my main form as text and there it was staring me in the face!!!!! Script.Strings = ( 'window.close();') I cannot for the life of me know why I placed that into the Java Script property on the main form, but as you can imagine, when it was removed, the application ran without the message appearing. I'll never forget this one! As always, all difficult problems have simple solutions! Quote Link to comment Share on other sites More sharing options...
GerhardV Posted September 26, 2018 Share Posted September 26, 2018 glad your figured it out. Quote Link to comment Share on other sites More sharing options...
Ron Posted October 3, 2018 Share Posted October 3, 2018 The dangerous thing with invisible form code. Better to have it with the rest, and inject it on create. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.