Browser close button / unload event

Hi,
In Ie8 session is carrying when i close the browser using X button. Is there any way to capture this browser close button or any portal unload event.
Thanks
Manu

There is no clean way to do this. The only way i know of is to have a private global javascript variable true/false (true = show the popup, false = show popup) where the default value is true. On every click of link / form submit where you need the popup to be suppressed , set the value as false. (you can do this using a js library which can attach events to onsubmit, onclick of all links)
However the behavior you are proposing is really , really annoying (as a user), consider your interface before implementing something like this. Valid usecases are prompting the user to save changes before leaving the page, not you are leaving the website (Thats why i typed something or closed the browser)

Similar Messages

  • Avoid browser close before quiz finish

    Hi
    i have created one Quiz web application using VS 2008 and i have set 10 min time using timer control to finish the quiz. User should not close the browser before he finishes the quiz within 10 min. After 10 min he can able to close browser close button or
    logout.
    How to achieve this using C# and asp.net. If anybody knows, please reply me.
    Thanks in advance.

    Hello san456,
    Please post ASP.NET related question to http://forums.asp.net/
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Portal session not being terminated. browser "unload" event

    This line of code is in the portallauncher.default and eventually causes the problem:
    EPCM.subscribeEvent("urn:com.sapportals.portal:browser", "unload", releaseProducerSessions);
    releaseProducerSessions eventually calls a portal component
    WSRPSessionRelease.. which is causing the problem.
    When we upgraded from EP 6.0 to NW 2004, users started recieving the Netweaver Login Screen when they logged out and logged back in, in the same browser. We think this error occurs because NW 2004 implements Web Services Remote Portal functionality.
    We are using SiteMinder as a third party session management tool.
    What we found was that the Siteminder session was being killed but the Portal session was not. Therefore, when users logged back in they would see the generic Netweaver Login Screen, and they could actually just hit "enter" and continue to the portal.
    A successful logoff, users clicked the logoff button, the DSM terminator was being called, thus killing the portal session, then a form was submitted redirecting the users the the siteminder loggoff page, which logs the users off siteminder.
    When the logoff failed, we found that after the DSM Terminator was called
    and before the page was being redirected, a portal component
    (WSRPSessionRelease) was being called, which in turn, RECREATED the portal session. So the user never actually gets logged off from the portal.
    We found that the WSRPSessionRelease component is set to
    a "browser" "unload" event when the portallauncher.default component is first loaded. This is the same component that is being called when the user clicks the "X" to force close the browser.
    Not everytime is the WSRPSessionRelase component being called before the redirect to the siteminder logg off page. Sometimes this component is called after the redirect, and we find that this is a successful loggoff.
    The component is:
    irj/servlet/prt/portal/prtroot/com.sap.portal.wsrp.coreconsumer.WSRPSessionRelease

    Hello Michael,
    The 'log off' issue is a known issue with Portal since EP 6
    Had faced similar issue and SAP suggests to redirect the 'log off' link to another non-SAP site...like your company intranet site.
    This will help the session to break.
    There are 1-2 SAP Notes on this as well.
    Hope this helps.
    Regards,
    Ritu

  • Unloading a loaded external SWF with a close button on the external SWF to unload

    I have found some discussion on this topic but I am still having trouble getting it to work and was hoping to get some help here.
    Here I have a file: http://www.dril-quip.com/test/main.swf
    I have: main.swf (a menu) and I have module.swf (content)
    If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent.
    So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.
    below is the code I used to load the file but I cant, for the life of me, find a way to unload it.
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
    Main FLA:
    function removeF() {
    removeChild(bigboreLoader);
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    EXTERNAL FLA:
    btnClose2.addEventListener(MouseEvent.CLICK, bigborecontent);
    function bigborecontent(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    I think I have a misunderstanding of the code. Thanks for any help you might be able to provide.

    This was the original code I got:
    Main FLA: (on AS layer inside DropDownButton Movie Object)
    function removeF() {
    removeChild(myLoader);
    var myLoader:Loader=new Loader ();
    page1_mc.addEventListener(MouseEvent.CLICK, page1content);
    function page1content(myevent:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("page1.swf");
    myLoader.load(myURL);
    addChild(myLoader);
    EXTERNAL FLA: (on main time line of this file)
    close_mc.addEventListener(MouseEvent.CLICK, closeMC);
    function closeMC(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    Main.FLA
    myLoader=bigboreLoader (my new loader)
    page1_mc=btnbb2 (the button who event will call external swf)
    page1content = bigborecontent (name given to SWF being loaded???)
    myURL=bigboreRequest (my new URLrequest for bigbore)
    page1.swf=moduletemplate.swf (actual address of what I am loading)
    External.FLA
    close_mc=button that will close external swf
    closeMC=movie clip to close?

  • Catching browser close event and showing my own popup

    Hi,
    I want to show my own warning popup on browser close event. Kindly help me with the solution.
    Thanks a lot in advance.
    Lavanya.

    Lavanya,
    I don't think you could show a ADF Popup during the onload event. Instead, you could use javascript's confirm method to prompt the user to choose what they want to do and perform that operation accordingly.
    Ex :
    jspx code
       <af:document id="d1" onunload="performUnloadEvent" clientComponent="true">
                <af:resource type="javascript">
                  // For Mozilla and Firefox
                  if(window.addEventListener){
                  window.addEventListener('beforeunload', function (event) {
                    showConfirm();
                  // For IE
                  else if(window.attachEvent){
                       window.attachEvent('onbeforeunload', function (event) {
                    showConfirm();
                  function showConfirm(){
                          var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
                          var sel = confirm("Are you sure you want to exit?");
                        if(sel==true){
                            alert('Perform OK Operation');
                            var x = AdfCustomEvent.queue(eventSource, "handleOnUnload", {result : 'ok'},false);
                            var y = 0;
                        else {
                        alert('Perform Cancel Operation');
                         var x = AdfCustomEvent.queue(eventSource, "handleOnUnload", {result : 'cancel'},false);
                         var y = 0;
                </af:resource>
                <af:serverListener type="handleOnUnload" method="#{UnloadHandler.onUnloadHandler}"/>
                <af:form id="f1" clientComponent="true">
                </af:form>
            </af:document>onUnloadHandler method in bean
        public void onUnloadHandler(ClientEvent clientEvent) {
            System.out.println("Unload Event fired..");
            String outcome = clientEvent.getParameters().get("result").toString();
            if(outcome.equalsIgnoreCase("ok")){
                System.out.println("Outcome is OK ");
                // Perform some operation like Commit;
            else if(outcome.equalsIgnoreCase("cancel")){
                System.out.println("Outcome is Cancel ");
                // Perform some cleanup operation like Rollback;
        }-Arun

  • Item Details - Event for 'Create', 'Close' buttons - possible?

    Hi Friends,
    I am looking for EPCF Events for Item Details iView. I am able to show the record in this iview by selectIdHandler. Now, i want to clear the iView content - the functionality when we click 'Close' button.
    So, does any one of you know any Events to fire Create, Close buttons on Item Details iView?
    Thanks,
    Raags

    Hello Raags,
    Have you discovered how to trigger any of those events? I'm having a similar issue.
    I need when I open the record to have it in Edit mode already, not to click the Edit button in order to get there.
    Let me know if you discovered a solution.
    Best regards,
    Boris

  • Where is the close button in nokia browser??!

    Hi,,
    *Please, where is the close button in nokia browser i mean inside the app beacuse i close it from the shutdown phone key??
    *How can i delete the input history (in the sites forms) like google?????
    *what is the best browser for Nokia Asha 303 instead of nokia browser??!

    *Thanks baghail,,
    There is no problem with opera mini, but nokia browser and deleteing the history and cookies didnt delete the (forms input history in sites).. idnt know how to do this in nokia browser??!
    *Thanks palani6:
    The "End key" u talking about isnt found in nokia browser app so that mean i didnt forgot it

  • Capturing browser close event

    Hello everyone,
    Even though this question has been answered before, I find that none of the answers seem to work for me.
    My problem is the following: Locks are placed on records and tables at certain points in my application. But if the user simply closes the browser without closing the application properly, all the locks are still in place. So I need to catch an event that allows me to ABAP my way out of this.
    I have the following BSP page which loads my application:
    function startBSPApplication()
    function endBSPApplication()
      <frameset id="<%=guid %>_FRAMESET" rows="*,0" onload="startBSPApplication('<%=guid %>_A');" onunload="exitBSPApplication();" noresize framespacing="0" frameborder="0" border="0">
        <frame name="<%=guid %>_A" src="session_default_frame.htm">
        <noframes>This browser does not support frames.</noframes>
      </frameset>
    The start and end functions simply start and end a session, and I find myself unable to actually call an ABAP function in there. All ABAP code placed inside the javascript functions is called everytime the page is loaded, not everytime the function is called and that's not what I want.
    I also already tried the <bsp:htmlbEvent> tag, but I couldn't get that to work either. I tried it like this:
    Notice however that I wrote this on top of the frameset. Does this mean that the onunload event will be called twice and does this cause a problem?
    I tried to call the onDestroy event from within my endBSP function, but nothing happened either.
    <htmlb:content design="design2003" >
      <htmlb:page title="Capture browser close " >
        <htmlb:form>
          <bsp:htmlbEvent id      = "myid"
                          onClick = "onDestroy"
                          name    = "onDestroy"/>
          <script for="window" event="onunload"  type="text/javascript">
               alert('Starting the Server Event');
               onDestroy();
           </script>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Does anybody have another suggestion, or notice me overlooking something?
    Thank you in advance,
    Niels.

    Hi Eddy,
    I can't find anything really helpful in that blog. Except maybe adding the onbeforeunload attribute to my frameset and calling a JS function to back it up.
    The problem still persists that any ABAP you put in a JS function is executed regardless of wether or not the function is actually called.
    I need to get to my DO_HANDLE_EVENT somehow when the user closes the window.

  • How to close the browser on button click?

    Hi,
    On a HTML page, I have a button labeled as "Close". When user click the button, I want to close the browser. I am using Apex 4 with 10g.
    I created the following process which I call on pressing the close button:
    BEGIN
    htp.p('<body>');
    htp.p('<script type="text/javascript">');
    --htp.p('window.opener.doSubmit();');
    htp.p('window.close();');
    htp.p('</script>');
    htp.p('</body>');
    END;But it shows the below in the browser instead of closing it.
    Location: f?p=17638:9:3591448756041585::NO
    Any wayout?
    Thx

    For popup windows I use button code / javascript such as this.
    The self function refere to the correct window, while window.close my be connected to the wrong (parent) window.
    input type="button" value="Cancel" onclick="self.close();"  id="CANCEL"Edited by: Sven W. on May 26, 2011 2:46 PM

  • Call Webservice/API during browser close event

    Hello,
    I am using JDEV 11g. My application catches the browser close event to call a return Task Flow.
    I am wondering if its possible to call a webservice/API during the same event.
    Thanks
    Padmapriya

    Probababy too late to ask .. did u manage to get this resolved.
    I am not able to call any server Listeners during browser close event ...
    Details here -Re: Calling an ActionListener on browser window close using JS event queuing

  • Browser Close Event

    Hi,
    I want to track Browser close event in EP to close all the sessions of the user.
    Plz guide me with detailed steps.
    Thanks in advance.
    Regards,
    Priya

    Hi search for "Browser close event" in google.
    Result: there is no such thing. You can do something with onbeforeunload but that might not work for all browser.
    Kai

  • Which Event is invoked on clicking the Close button of AIR Window

    Hello
    I am trying to capture the event; which is invoked when we close the AIR window by clicking its Close button (on the top-right corner). I have tried the following; but none of them seems invoked:
    Code:
    newWin.stage.addEventListener(Event.CLOSING, closeHandler);
    newWin.stage.addEventListener(Event.EXITING, closeHandler);
    newWin.stage.addEventListener(Event.REMOVED, closeHandler);
    newWin.stage.addEventListener(Event.DEACTIVATE, closeHandler);
    newWin.stage.addEventListener(Event.REMOVED_FROM_STAGE, closeHandler);
    The code for the said problem is something like the following:
    Code:
    var initOptions: NativeWindowInitOptions = new NativeWindowInitOptions();
    initOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
    var newWin: NativeWindow = new NativeWindow(initOptions);;
    newWin.stage.addEventListener(Event.CLOSING, closeHandler);
    Would anybody kindly help!

    I wonder, no geek came forward for rescue! I am still hopeful to get a response from Adobe AIR wizards.

  • JDialog close button event.

    Hi ..
    I wanna know how to handle the close button at the right top of the JDialog window. Im referring to the cross button. We can do it throught windoClosing event in Frames, but how can we do it for JDialog!
    any sort of help would be appreciated.
    Cheers!
    Asim

    Hi ..
    I wanna know how to handle the close button at the
    right top of the JDialog window. Im referring to the
    cross button. We can do it throught windoClosing event
    in Frames, but how can we do it for JDialog!
    any sort of help would be appreciated.
    Cheers!
    AsimSame in JDialog:-
           dialog.addWindowListener(new java.awt.event.WindowAdapter()
                public void windowClosing(java.awt.event.WindowEvent evt)
                    // Your code over here.
            });Debopam.

  • How to catch browser close event excluding navigation events

    Hi,
    I tried using onBeforeUnload event and onUnload events.. but they are catching navigation events within the same site. Could you please let me know how I can catch browser close events without catching Navigation events?
    Thanks.

    Just set them to null when navigation takes place.
    Said that, you should be asking Javascript/DHTML related questions in a forum devoted to Javascript/DHTML. There are ones at webdeveloper.com and dynamicdrive.com. This has nothing to do with Java.

  • How to detect browser close event in flex ?

    How to detect browser close event in flex ?

    This link may help:
    http://cookbooks.adobe.com/post_Close_event_of_browser_or_browser_tab-18211.html
    Best,

Maybe you are looking for

  • Sender File Channel unable to process

    Hi, I have a scenario where we are using a sender file channel. It polls every 1 hour at the source directory. Suddenly yesterday the channel stopped processing and never polled again automatically. It started the processing but did not finish the pr

  • Restore Preview default background?

    Hello! Can you help me guys? How can I restore the default background in Preview? (10.7 Lion). I changed it to a color in the preferences but I can't change it back to the default texture... :S (that is here by the way: /System/Library/Frameworks/App

  • HP 4500 All in One Printer

    Is HP 4500 All in One Model SNPRC-0902-01 wireless, i.e., does it have wireless capability.  It is presently connected to my Windows 7 computer with a USB cable. This question was solved. View Solution.

  • How to reformat my iphone

    How to reformat my iphone 4

  • Version history Smartform?

    Hello experts, is there a version history for smartforms like for reports, fm´s .... ? In transaction SMARTFORM i can not find it.