Using javascript for pinging a webapp to keep session open

前端 未结 6 817
一个人的身影
一个人的身影 2021-01-31 10:26

I\'m writing a greasemonkey script to keep session open on a webapp I use for work. Which javascript command would you use to create some feedback with the server and ensure the

6条回答
  •  暖寄归人
    2021-01-31 10:58

    Second choice

    If you absolutely insist on using Greasemonkey, any element.click() method on any event that submits an XMLHTTPrequest should do.

    First choice

    If you are willing to use a solution that does not require you to write a Greasemonkey script:

    ReloadEvery 3.0.0, by Jaap Haitsma

    This reloads web pages every so many seconds or minutes. The function is accessible via the context menu (the menu you get when you right click on a web page) or via a drop down menu on the reload button.

    It's not what you asked for, but unless you simply want to brush up on your javascript skills, this is probably the most straight-forward method for solving your problem.

提交回复
热议问题