CN113806650A - Webpage application processing method and device, storage medium and electronic equipment - Google Patents

Webpage application processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113806650A
CN113806650A CN202111087222.8A CN202111087222A CN113806650A CN 113806650 A CN113806650 A CN 113806650A CN 202111087222 A CN202111087222 A CN 202111087222A CN 113806650 A CN113806650 A CN 113806650A
Authority
CN
China
Prior art keywords
window
application
storage information
storage
browser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111087222.8A
Other languages
Chinese (zh)
Inventor
邱程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111087222.8A priority Critical patent/CN113806650A/en
Publication of CN113806650A publication Critical patent/CN113806650A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Abstract

The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for processing a web application, a computer-readable storage medium, and an electronic device, where the method includes: responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage; the first storage information is used for indicating the opening time of the webpage application in the first window; responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in a local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window. By the technical scheme of the embodiment of the disclosure, the problem that the application data of the same webpage opened in a plurality of windows of the browser cannot be synchronized can be solved.

Description

Webpage application processing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a web application, a computer-readable storage medium, and an electronic device.
Background
With the rapid development of the internet, a large number of webpage applications emerge, a Web application program is an application program which can be accessed through the Web, and the greatest benefit of the program is that a user can easily access the application program, and the user can access the webpage applications through the browser only by using the browser without installing other software.
When a user accesses a web application through a browser, the same application may be opened in different windows, and at this time, poor user experience may be caused because data of the web applications in different windows cannot be synchronized. For example, when a user accesses a web application through a browser, the same application is opened in different windows, data input by the user in the web application of a certain window cannot be synchronized to web applications of other windows, or after a form is opened in the web application of a certain window, the same form cannot be opened in the web applications of other windows, so that the user experience is poor.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure aims to provide a method and a device for processing a webpage application, a computer-readable storage medium and an electronic device, which can solve the problem that data of the same webpage application cannot be synchronized when the same webpage application is opened in a plurality of windows of a browser.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a method for processing a web application is provided, which includes: responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage; the first storage information is used for indicating the opening time of the webpage application in the first window; responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in a local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window.
Optionally, storing the first storage information corresponding to the web application in the local storage includes: acquiring a storage interface corresponding to a local storage; and storing the first storage information corresponding to the webpage application in the local memory according to the storage interface corresponding to the local memory.
Optionally, storing the second storage information in the local storage includes: and updating the first storage information in the local storage into the second storage information.
Optionally, updating the first storage information in the local storage to the second storage information includes: and deleting the first storage information in the local storage, and storing second storage information corresponding to the webpage application in the local storage.
Optionally, the web application for closing the first window of the browser includes: registering a storage information change event in the webpage application in response to storing first storage information corresponding to the webpage application in the local storage; and closing the webpage application of the first window according to the storage information change event.
Optionally, the closing the web application of the first window according to the storage information change event includes: storing first storage information corresponding to the webpage application into a key value of the storage information change event; and closing the webpage application of the first window when the data change of the key value is monitored.
Optionally, when the data change of the key value is monitored, closing the web application of the first window includes: storing second storage information corresponding to the webpage application into a key value of the storage information change event; and notifying the first window of the data change of the key value, and executing a callback method to close the webpage application of the first window.
Optionally, the first storage information and the second storage information are time stamps.
According to a second aspect of the present disclosure, there is provided a processing apparatus for a web application, the processing apparatus comprising: the first window opening module is used for responding to the opening of a webpage application in a first window of the browser and storing first storage information corresponding to the webpage application in the local storage; the first storage information is used for indicating the opening time of the webpage application in the first window; the second window opening module is used for responding to the opening of the webpage application in the second window of the browser, storing second storage information corresponding to the webpage application in the local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to implement the processing method of the web application as in the first aspect of the embodiments described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
one or more processors; and
a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of processing a web application as in the first aspect of the embodiments described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the processing method of the web application provided by an embodiment of the present disclosure, when the storage information in the local storage changes, the newly opened web application may be retained. On one hand, when a user opens the same webpage application in different windows of the browser, the newly opened webpage application can be reserved, the same webpage application is prevented from being displayed in a plurality of windows of the browser, and therefore the problem that other webpage applications cannot synchronize data after the user inputs data in a certain webpage application is avoided; on the other hand, the increase of the application quantity of the same webpage in the browser can be avoided, so that the simplicity of the browser is improved, and the use experience of a user is further ensured; on the other hand, the webpage application is closed through the data change condition of the local storage of the browser, the influence of network break or weak network can be avoided, the closing of the webpage application can be completed locally in the browser, the load of the server is reduced, the stability of the browser is improved, and the user experience is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 schematically illustrates a schematic diagram of an exemplary system architecture to which a method of processing a web application of an embodiment of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow chart of a method for processing a web application in an exemplary embodiment of the disclosure;
fig. 3 schematically illustrates a flowchart of storing first storage information corresponding to a web application in a local storage according to a storage interface corresponding to the local storage in an exemplary embodiment of the present disclosure;
FIG. 4 is a flow diagram schematically illustrating a web application closing a first window according to a stored information change event in an exemplary embodiment of the present disclosure;
FIG. 5 is a flow chart schematically illustrating a web application closing a first window upon listening to a data change of a key value in an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a flowchart of a web application notifying a first window of a change in data of a key value and executing a callback method to close the first window in an exemplary embodiment of the present disclosure;
FIG. 7 is a flow diagram schematically illustrating a web application closing a first window of a browser according to an application closing program in an exemplary embodiment of the present disclosure;
FIG. 8 schematically illustrates a flow chart of a web application closing other windows according to a timestamp change event in an exemplary embodiment of the present disclosure;
FIG. 9 is a schematic diagram illustrating a component of a processing device for a web application according to an exemplary embodiment of the disclosure;
fig. 10 schematically illustrates a structural diagram of a computer system suitable for use in an electronic device to implement an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram illustrating an exemplary system architecture to which a processing method of a web application of the embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 1000 may include one or more of terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. Network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, the server 1005 may be a server cluster composed of a plurality of servers.
A user may use the terminal devices 1001, 1002, 1003 to interact with a server 1005 via a network 1004 to receive or transmit messages or the like. The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like. In addition, the server 1005 may be a server that provides various services.
In one embodiment, the executing body of the processing method of the web application of the present disclosure may be the server 1005, and the server 1005 may acquire the first storage information and the second storage information transmitted by the terminal devices 1001, 1002, and 1003, process the first storage information and the second storage information according to the processing method of the web application of the present disclosure, and then return a signal of the web application closing the first window of the browser obtained after the processing to the terminal devices 1001, 1002, and 1003. Further, the processing method of the web application of the present disclosure may also be executed by the terminal devices 1001, 1002, 1003, and the like to implement a process of closing the web application of the first window of the browser.
In addition, the implementation process of the processing method of the web application of the present disclosure may also be implemented by the terminal devices 1001, 1002, 1003 and the server 1005 together. For example, the terminal devices 1001, 1002, 1003 may acquire the first storage information and store the first storage information in the local memory, and then transmit the storage state of the local memory to the server 1005, so that the server 1005 may store the second storage information corresponding to the web application in the local memory and close the web application of the first window of the browser in response to opening the web application in the second window of the browser.
With the rapid development of the internet, a large number of webpage applications are emerged, the webpage applications are application programs which can be accessed through webpages, the greatest benefit of the webpage applications is that users can easily access the application programs, and the users can access the webpage applications through the browsers only by the aid of the browsers without installing other software, so that the requirements of the users can be met.
When a user accesses a web application through a browser, the same web application may be opened in different windows, and at this time, poor user experience may be caused because data of the web applications in different windows cannot be synchronized.
For example, when a user accesses a web application through a browser, the same application is opened in different windows, data input by the user in the web application of a certain window cannot be synchronized to web applications of other windows, or after a form is opened in the web application of a certain window, the same form cannot be opened in the web applications of other windows, so that the user experience is poor.
In addition, the same webpage applications are opened in different windows, and because the corresponding data of the webpage applications may be different when the webpage applications are opened at different times, the user needs to search the newly opened webpage applications, and because the user opens a plurality of the same webpage applications in the browser, the number of the webpage applications is large, and the same webpage applications are very similar in display, so that the user has certain difficulty in searching the newly opened webpage applications, and the user experience is poor.
In an example embodiment of the present disclosure, first storage information corresponding to a web application may be stored in a local storage in response to opening the web application in a first window of a browser, and second storage information corresponding to the web application may be stored in the local storage in response to opening the web application in a second window of the browser, and the web application of the first window of the browser may be closed. Referring to fig. 2, a flowchart illustrating a processing method of a web application in the present exemplary embodiment may include the following steps:
step S210: responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage; the first storage information is used for indicating the opening time of the webpage application in the first window;
step S220: responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in a local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window.
In the processing method of the web application provided by an embodiment of the present disclosure, when the storage information in the local storage changes, the newly opened web application may be retained. On one hand, when a user opens the same webpage application in different windows of the browser, the newly opened webpage application can be reserved, the same webpage application is prevented from being displayed in a plurality of windows of the browser, and therefore the problem that other webpage applications cannot synchronize data after the user inputs data in a certain webpage application is avoided; on the other hand, the increase of the application quantity of the same webpage in the browser can be avoided, so that the simplicity of the browser is improved, and the use experience of a user is further ensured; on the other hand, the webpage application is closed through the data change condition of the local storage of the browser, the influence of network break or weak network can be avoided, the closing of the webpage application can be completed locally in the browser, the load of the server is reduced, the stability of the browser is improved, and the user experience is further improved.
Next, steps S210 to S220 of the processing method of the web application in the present exemplary embodiment will be described in more detail with reference to fig. 1 and the embodiment.
Step S210, responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage;
in an example embodiment of the present disclosure, in response to opening a web application in a first window of a browser, first stored information corresponding to the web application may be stored in a local memory. Specifically, the first storage information corresponding to the web application may be generated in response to opening a web application in a first window of the browser. Specifically, a browser refers to an application program used to retrieve, display and transmit a Web information Resource, where the Web information Resource is marked by a Uniform Resource Identifier (URI), and is a Web page, a picture, a video or any content presented on the Web, and a user can browse the Web information Resource through the browser.
In an example embodiment of the present disclosure, when a web application is opened in a window of a browser, storage information corresponding to the web application may be generated. Specifically, the storage information is used to indicate the open time of the web application. The first stored information of the web application may include numbers, words, codes, and the like. For example, the first storage information of the web application may be a serial number, and when the web application is opened in the browser, the first storage information corresponding to the web application that is opened first may be set to tp1, that is, the web application is the first web application that is opened; for another example, the first storage information of the web application may be a time stamp, and when a web application is opened in the first window of the browser, the opening time of the web application may be acquired, and the time stamp corresponding to the time may be set as the first storage information. It should be noted that the present disclosure is not limited to the specific form of the first storage information.
Further, when the browser communicates with the server, the communication connection between the browser and the server can be established through a transmission protocol. For example, the communication connection between the browser and the server may be established through a hypertext transfer protocol, where the hypertext transfer protocol includes establishing a connection, sending a request, returning a response, and closing the connection, and the communication between the browser and the server is completed through the above steps.
In an example embodiment of the present disclosure, a window of a browser refers to an interface for presenting a network information resource, and a web application may be viewed through the window of the browser. By way of example, a window of a browser may include a menu bar, an editing tool bar, a standard button, an address path, a detailed information bar, a close current window, a maximize current window, a minimize current window, a drop down button, folder contents of a current path, and the like. It should be noted that the present disclosure is not limited to the items of the window of the browser. Further, the window of the browser may include a primary window, a secondary window, and the like. It should be noted that the present disclosure is not limited to the browser window hierarchy.
In an example embodiment of the present disclosure, the web application is an application program that can be accessed through a web page, and the greatest benefit of the web application is that a user can easily access the application program, and the user only needs to have a browser and does not need to install other software. Specifically, the web application may include a B/S mode web application, and the web application may be written in a programming language and run based on a web page. The web application is composed of various web components that accomplish specific tasks, and displays services through a window of a browser. For example, a web application may be composed of multiple servlets, JSP pages, HTML files, image files, and the like. It should be noted that the form of the web application is not particularly limited in the present disclosure.
In an example embodiment of the present disclosure, the web application may include a plurality of types of web applications. By way of example, the web applications may include office web applications, internet web applications, multimedia web applications, analytics web applications, collaborative web applications, business web applications, and the like. It should be noted that the present disclosure is not limited to the type of the web application.
In an example embodiment of the present disclosure, first storage information corresponding to a web application may be stored in a local storage. In particular, the local storage may include a storage space of the browser itself. For example, the local Storage may include Storage space provided by the browser, and the Storage space has a permanent life cycle, and is only stored in the browser and does not participate in server communication. It should be noted that the present disclosure is not limited to a specific type of local storage.
In an example embodiment of the present disclosure, first storage information corresponding to a web application may be stored in a local storage. Specifically, the first storage information corresponding to the web page application may be sent to the local storage for storage, or the local storage may actively access the first storage information of the web page application and store the first storage information of the web page application in the local storage, or after the first storage information corresponding to the web page application is obtained, the storage middleware may be invoked and store the first storage information corresponding to the web page in the local storage through the storage middleware. It should be noted that, in the present disclosure, a specific manner of storing the first storage information corresponding to the web application in the local storage is not particularly limited.
In an example embodiment of the present disclosure, a storage interface corresponding to a local storage may be acquired, and first storage information corresponding to a web application may be stored in the local storage according to the storage interface corresponding to the local storage. Referring to fig. 3, storing the first storage information corresponding to the web application in the local storage according to the storage interface corresponding to the local storage may include the following steps S310 to S320:
step S310, acquiring a storage interface corresponding to the local storage;
step S320, storing the first storage information corresponding to the web application in the local storage according to the storage interface corresponding to the local storage.
In an example embodiment of the present disclosure, a storage interface corresponding to a local storage may be obtained. Specifically, the local storage may be called through a storage interface corresponding to the local storage, and the first storage information corresponding to the web application is stored in the local storage. For example, the Storage interface corresponding to the local Storage is localStorage, and the localStorage can be called, and the first Storage information is stored in the storagege. It should be noted that, the present disclosure is not limited to the specific type of the local storage and the storage interface corresponding to the local storage.
Through the steps S310 to S320, the storage interface corresponding to the local storage may be obtained, and the first storage information corresponding to the web application may be stored in the local storage according to the storage interface corresponding to the local storage.
Step S220, responding to the opening of the webpage application in the second window of the browser, storing second storage information corresponding to the webpage application in a local storage, and closing the webpage application of the first window of the browser;
in an example embodiment of the present disclosure, a web application may be opened in a second window in a browser. Wherein the web application is the same web application as the web application opened in the first window of the browser. Specifically, the second window of the browser may include a window at the same level as the first window of the browser, and may also include a secondary window of the first window of the browser, and the like. In the present disclosure, the specific form of the second window of the browser is not particularly limited, and may be a window belonging to the same browser.
In an example embodiment of the present disclosure, after the web application is opened in the second window of the browser, second storage information corresponding to the web application may be generated. Wherein, the second stored information of the web application may include numbers, words, codes, etc. For example, the second storage information of the web application may be a serial number, when the web application is opened in the browser, the first storage information corresponding to the web application that is opened first may be set to tp1, that is, the web application is a web application opened in the first window, and the second storage information corresponding to the web application that is opened second is set to tp2, that is, the web application is a web application opened in the second window, where the application opening time represented by tp1 is earlier than the application opening time represented by tp 2; for another example, the second storage information of the web application may be a time stamp, and when a web application is opened in the second window of the browser, the opening time of the web application may be acquired, and the time stamp corresponding to the time may be set as the second storage information. It should be noted that the present disclosure is not limited to a specific form of the second storage information. It should be noted that the first storage information corresponding to the generated web application is the same as the second storage information corresponding to the generated web application, that is, the first storage information corresponding to the generated web application is in the same form as the second storage information corresponding to the generated web application.
For example, the storage information is a timestamp, the time for opening the web application in the first window is 19 hours-31 minutes-44 seconds, at this time, the time may be used as the first storage information corresponding to the web application opened in the first window, and the time for opening the web application in the second window is 19 hours-32 minutes-22 seconds, at this time, the time may be used as the second storage information corresponding to the web application opened in the second window.
In an example embodiment of the present disclosure, second storage information corresponding to the web application may be stored in the local storage. Specifically, after second storage information corresponding to the web page application is generated, the second storage information corresponding to the web page application may be sent to the local storage for storage, or the local storage may actively access the second storage information corresponding to the web page application and store the second storage information corresponding to the web page application in the local storage, or after the second storage information corresponding to the web page application is obtained, a storage middleware may be invoked and store the second storage information corresponding to the web page in the local storage through the storage middleware. It should be noted that, in the present disclosure, a specific manner of storing the second storage information corresponding to the web application in the local storage is not particularly limited.
In an example embodiment of the present disclosure, the second storage information may be stored in a local memory. Specifically, the second storage information may be directly stored in the local storage. For example, 19 hours-31 minutes-44 seconds of first storage information corresponding to the web application may be stored in the local storage, and 19 hours-32 minutes-22 seconds of second storage information corresponding to the web application may be obtained, at this time, 19 hours-32 minutes-22 seconds may be directly stored in the local storage, that is, the local storage includes 19 hours-31 minutes-44 seconds of first storage information corresponding to the web application and 19 hours-32 minutes-22 seconds of second storage information corresponding to the web application.
Alternatively, the first storage information in the local storage may be updated to the second storage information. For example, the first storage information 20 hours-23 minutes-15 seconds corresponding to the web application may be stored in the local storage, and the second storage information 20 hours-35 minutes-12 seconds corresponding to the web application is obtained, at this time, the first storage information 20 hours-23 minutes-15 seconds corresponding to the web application may be updated to the second storage information 20 hours-35 minutes-12 seconds corresponding to the web application, that is, the first storage information 20 hours-23 minutes-15 seconds corresponding to the web application is updated and deleted, and then the second storage information 20 hours-35 minutes-12 seconds corresponding to the web application is filled in the local storage, and at this time, the local storage only includes the second storage information 20 hours-35 minutes-12 seconds corresponding to the web application.
It should be noted that, in the present disclosure, a specific manner of storing the second storage information in the local storage is not particularly limited.
In an example embodiment of the present disclosure, after the second storage information is stored in the local storage through the above steps, the web application of the first window of the browser may be closed. Specifically, storing the second storage information in the local storage may indicate that the same web application as the web application corresponding to the first storage information is opened in the second window of the current browser. Therefore, in order to avoid opening the same web application in the same browser, the web application that is opened first may be closed, and the web application that is opened later may be retained, so as to ensure that only one web application is opened in the current browser, and each item of data of the web application in the browser is the latest data at this time.
For example, the web applications opened in the first window and the second window of the browser are used to display the current time, the time displayed in the web application in the first window is 20 hours-46 minutes-24 seconds, the time displayed in the web application in the second window is 20 hours-53 minutes-45 seconds, the time displayed in the web application in the second window is the latest time, and at this time, the web application in the first window may be closed. It should be noted that, the present disclosure is not limited to a specific manner of closing the web application of the first window of the browser.
In an example embodiment of the present disclosure, a change event of storage information may be registered in a web application in response to storing first storage information corresponding to the web application in a local storage, and the web application of a first window may be closed according to the change event of storage information. Referring to fig. 4, the closing of the web application of the first window according to the storage information change event may include the following steps S410 to S420:
step S410, in response to storing the first storage information corresponding to the webpage application in the local storage, registering a storage information change event in the webpage application;
step S420, closing the web application of the first window according to the storage information change event.
In an example embodiment of the present disclosure, a storage information change event may be registered when the first storage information is stored in the local storage, and the web application of the first window may be closed when the event is triggered. Specifically, the application storage information change event may be used to indicate an open state of the same web application in other windows in the browser, and if the same web application is opened in other windows in the browser, the web application in the first window needs to be closed at this time.
Specifically, the processing tool for closing the web application of the first window may be called in the storage information change event, and the web application of the first window is closed through the processing tool. It should be noted that, the present disclosure is not limited specifically to the specific manner of closing the web application of the first window according to the storage information change event.
Through the above steps S410 to S420, in response to storing the first storage information corresponding to the web application in the local storage, the application storage information change event may be registered in the web application, and the web application of the first window may be closed according to the storage information change event.
In an example embodiment of the present disclosure, the first storage information corresponding to the web application may be stored in a key value of the storage information change event, and the web application of the first window may be closed when a data change of the key value is monitored. Referring to fig. 5, when the change of the key value data is monitored, closing the web application of the first window may include the following steps S510 to S520:
step S510, storing first storage information corresponding to the webpage application into a key value of the storage information change event;
step S520, when the data change of the key value is monitored, closing the webpage application of the first window.
In an example embodiment of the present disclosure, when a web application is opened in a first window, a storage information change event may be registered, where the storage information change event corresponds to a key value, and the storage information corresponding to the web application may be stored in the key value. Specifically, when the web application is opened in the first window, the first storage information corresponding to the web application may be stored in the key value of the storage information change event.
At this time, a monitoring interface can be called to monitor the key value, and when the data change of the key value is monitored, it can be shown that the same webpage application is opened again in other windows of the browser at present, and the webpage application of the first window can be closed. Specifically, the data change of the key value may include storing new storage information, or the data change of the key value may include updating storage information stored in the key value to another storage information, and the like.
Through the steps S510 to S520, the first storage information corresponding to the web application may be stored in the key value of the storage information change event, and the web application of the first window may be closed when the data change of the key value is monitored.
In an example embodiment of the present disclosure, the second storage information corresponding to the web application may be stored in the key value of the storage information change event, the data change of the key value is notified to the first window, and the callback method is executed to close the web application of the first window. Referring to fig. 6, notifying the first window of the data change of the key value and executing the callback method to close the web application of the first window may include the following steps S610 to S620:
step S610, storing second storage information corresponding to the webpage application into a key value of the storage information change event;
step S620, notify the first window of the data change of the key value, and execute the callback method to close the web application of the first window.
In an example embodiment of the present disclosure, after the first storage information is stored in the key value of the storage information change event through the above steps, the key value may be snooped through the snoop interface. When the web application is opened in the second window and the second storage information is stored in the key value, the data change of the key value is monitored, that is, the message of the data change of the key value can be sent to other windows (namely, the first window) except the second window, and the first window closes the web application of the first window according to a callback method written in the monitoring interface in advance. It should be noted that, the specific manner of executing the callback method to close the web application of the first window is not particularly limited in this disclosure.
In an example embodiment of the present disclosure, an application closing program corresponding to a browser is acquired, and a web application of a first window of the browser is closed according to the application closing program. Referring to fig. 7, the closing of the web application of the first window of the browser according to the application closing program may include the following steps S710 to S720:
step S710, acquiring an application closing program corresponding to the browser;
step S720, closing the web application of the first window of the browser according to the application closing program.
In an example embodiment of the present disclosure, an application closing program corresponding to a browser may be acquired. Specifically, the application closing program corresponding to the browser may be used to close the web application in a certain window in the browser. After the application closing program corresponding to the browser is acquired, the webpage application of the first window of the browser can be closed through the application closing program. Specifically, the web application is opened in the second window of the browser, which indicates that the new storage information is stored in the local storage, and other web applications except the web application corresponding to the new storage information may be closed, that is, the web application of the first window is closed.
Further, when the web application of the first window of the browser is closed according to the application closing program, an interface of the application closing program may be called first, and the web application of the first window may be closed through the interface. For example, after the second storage information is stored in the local storage, the application shutdown program may be called by javascript to close the interface of the application shutdown program, and the web application of the first window may be closed through the interface. It should be noted that, the present disclosure is not limited to a specific manner of closing the web application of the first window of the browser according to the application closing program.
Through the steps S710 to S720, the application closing program corresponding to the browser may be acquired, and the web application of the first window of the browser may be closed according to the application closing program.
In an example embodiment of the present disclosure, a web application may be opened in a first window of a browser, a first timestamp corresponding to the web application may be generated by a javascript script, a timestamp change event may be registered, the first timestamp may be stored in a key value of the timestamp change event, and a data change condition of the key value may be monitored, the same web application may be opened in a second window of the browser, a second timestamp corresponding to the web application may be generated by the javascript script, and the second timestamp may be stored in the key value of the timestamp change event, at which time the timestamp monitoring of the key value changes, a message of the timestamp change may be dispatched to an application program of the first window of the browser, when the first window of the browser receives the message of the timestamp change, an interface of an application closing program in the browser may be invoked to close the web application in the first window, and only the webpage application of the second window of the browser is reserved at the moment, and the key value is continuously monitored, namely the webpage application of the newly opened window can close the webpage applications of other windows through the timestamp change event. Referring to fig. 8, the closing of the web application of the other window according to the timestamp change event may include the following steps S810 to S840:
step S810, a webpage application is opened in a first window of a browser, a first timestamp corresponding to the webpage application is generated through a javascript script, the first timestamp is stored in a key value of a timestamp change event, and the data change condition of the key value is monitored; step S820, opening the same webpage application in a second window of the browser, generating a second timestamp corresponding to the webpage application through a javascript script, and storing the second timestamp in a key value of a timestamp change event; step S830, monitoring that the timestamp of the key value changes, and dispatching a message of the timestamp change to an application program of a first window in the browser; step 840, when the first window of the browser receives the message with the changed timestamp, the interface of the application closing program in the browser can be called to close the web application in the first window; and step S850, continuously monitoring the key value, and closing the same webpage application of other windows through the timestamp change event when the same webpage application is opened in a new window.
In an example embodiment of the present disclosure, first storage information corresponding to a web application may be stored in a local storage in response to opening the web application in a first window of a browser, and second storage information corresponding to the web application may be stored in the local storage in response to opening the web application in a second window of the browser, and the web application of the first window of the browser may be closed.
In the processing method of the web application provided by an embodiment of the present disclosure, when the storage information in the local storage changes, the newly opened web application may be retained. On one hand, when a user opens the same webpage application in different windows of the browser, the newly opened webpage application can be reserved, the same webpage application is prevented from being displayed in a plurality of windows of the browser, and therefore the problem that other webpage applications cannot synchronize data after the user inputs data in a certain webpage application is avoided; on the other hand, the increase of the application quantity of the same webpage in the browser can be avoided, so that the simplicity of the browser is improved, and the use experience of a user is further ensured; on the other hand, the webpage application is closed through the data change condition of the local storage of the browser, the influence of network break or weak network can be avoided, the closing of the webpage application can be completed locally in the browser, the load of the server is reduced, the stability of the browser is improved, and the user experience is further improved.
It is noted that the above-mentioned figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
In addition, in an exemplary embodiment of the disclosure, a processing device of a web application is also provided. Referring to fig. 9, a processing apparatus 900 for a web application includes: a first window opening module 910, a second window opening module 920.
The first window opening module is used for responding to opening of a webpage application in a first window of the browser and storing first storage information corresponding to the webpage application in the local storage; the first storage information is used for indicating the opening time of the webpage application in the first window; the second window opening module is used for responding to the opening of the webpage application in the second window of the browser, storing second storage information corresponding to the webpage application in the local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window.
Optionally, the first storage information corresponding to the web application is stored in the local storage, and the apparatus further includes: the storage interface acquisition unit is used for acquiring a storage interface corresponding to the local storage; and the first storage unit is used for storing the first storage information corresponding to the webpage application in the local storage according to the storage interface corresponding to the local storage.
Optionally, the second storage information is stored in the local storage, and the apparatus further includes: and the storage information updating unit is used for updating the first storage information in the local storage into the second storage information.
Optionally, the first storage information in the local storage is updated to the second storage information, and the apparatus further includes: and the storage information deleting unit is used for deleting the first storage information in the local storage and storing the second storage information corresponding to the webpage application in the local storage.
Optionally, the apparatus further includes: a change event sending unit for sending a storage information change event to the first window in response to the second storage information being stored in the local storage; and the first webpage application closing unit is used for closing the webpage application of the first window according to the storage information change event.
Optionally, the apparatus further includes: the change event registration unit is used for responding to the first storage information corresponding to the webpage application stored in the local storage and registering the storage information change event in the webpage application; and the second webpage application closing unit is used for closing the webpage application of the first window according to the storage information change event.
Optionally, the apparatus further includes: the first storage information storage unit is used for storing the first storage information corresponding to the webpage application into the key value of the storage information change event; and the third webpage application closing unit is used for closing the webpage application of the first window when the data change of the key value is monitored.
Optionally, when the data change of the key value is monitored, the web application of the first window is closed, and the apparatus further includes: the second storage information storage unit is used for storing second storage information corresponding to the webpage application into the key value of the storage information change event; and the fourth webpage application closing unit is used for notifying the first window of the data change of the key value and executing the callback method to close the webpage application of the first window.
Optionally, the apparatus further includes: the application closing program acquisition unit is used for acquiring an application closing program corresponding to the browser; and the fifth webpage application closing unit is used for closing the webpage application of the first window of the browser according to the application closing program.
Optionally, the first storage information and the second storage information are time stamps.
As each functional module of the processing apparatus of the web application in the exemplary embodiment of the present disclosure corresponds to the step of the exemplary embodiment of the processing method of the web application, for details that are not disclosed in the embodiment of the apparatus of the present disclosure, please refer to the embodiment of the processing method of the web application described above in the present disclosure.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the virtual light control method of the virtual studio is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1000 according to such an embodiment of the present disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 is embodied in the form of a general purpose computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, a bus 1030 connecting different system components (including the memory unit 1020 and the processing unit 1010), and a display unit 1040.
Where the storage unit stores program code that may be executed by the processing unit 1010 to cause the processing unit 1010 to perform the steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above in this specification. For example, the processing unit 1010 may perform step S210 as shown in fig. 2: responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage; the first storage information is used for indicating the opening time of the webpage application in the first window; step S220: responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in a local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application opened in the second window.
As another example, the electronic device may implement the various steps shown in FIG. 2.
The memory unit 1020 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1021 and/or a cache memory unit 1022, and may further include a read-only memory unit (ROM) 1023.
Storage unit 1020 may also include a program/utility 1024 having a set (at least one) of program modules 1025, such program modules 1025 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1030 may be any one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, and a local bus using any of a variety of bus architectures.
The electronic device 1000 may also communicate with one or more external devices 1070 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 1050. Also, the electronic device 1000 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1060. As shown, the network adapter 1060 communicates with the other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (12)

1. A method for processing a web application, comprising:
responding to a webpage application opened in a first window of a browser, and storing first storage information corresponding to the webpage application in a local storage; wherein the first storage information is used for indicating the opening time of the webpage application in the first window;
responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in the local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application in the second window.
2. The method of claim 1, wherein storing the first stored information corresponding to the web application in the local memory comprises:
acquiring a storage interface corresponding to the local storage;
and storing first storage information corresponding to the webpage application in the local memory according to a storage interface corresponding to the local memory.
3. The method of claim 1, wherein storing the second stored information in the local memory comprises:
and updating the first storage information in the local storage to the second storage information.
4. The method of claim 3, wherein updating the first stored information in the local memory to the second stored information comprises:
and deleting the first storage information in the local storage, and storing the second storage information corresponding to the webpage application in the local storage.
5. The method of claim 1, wherein closing the web application of the first window of the browser comprises:
in response to storing first storage information corresponding to the webpage application in the local storage, registering a storage information change event in the webpage application;
and closing the webpage application of the first window according to the storage information change event.
6. The method of claim 5, wherein closing the web application of the first window according to the stored information change event comprises:
storing first storage information corresponding to the webpage application into the key value of the storage information change event;
and closing the webpage application of the first window when monitoring the data change of the key value.
7. The method of claim 6, wherein the monitoring that the data of the key value changes and closing the webpage application of the first window comprises:
storing second storage information corresponding to the webpage application into the key value of the storage information change event;
and notifying the first window of the data change of the key value, and executing a callback method to close the webpage application of the first window.
8. The method of claim 1, wherein closing the web application of the first window of the browser comprises:
acquiring an application closing program corresponding to the browser;
and closing the webpage application of the first window of the browser according to the application closing program.
9. The method of claim 1, wherein the first stored information and the second stored information are time stamps.
10. A processing apparatus for a web application, the processing apparatus comprising:
the first window opening module is used for responding to the opening of a webpage application in a first window of a browser and storing first storage information corresponding to the webpage application in a local storage; wherein the first storage information is used for indicating the opening time of the webpage application in the first window;
the second window opening module is used for responding to the opening of the webpage application in a second window of the browser, storing second storage information corresponding to the webpage application in the local storage, and closing the webpage application of the first window of the browser; wherein the second storage information is used for indicating the opening time of the webpage application in the second window.
11. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, causes the processor to carry out the method according to any one of claims 1 to 9.
12. An electronic device, comprising:
one or more processors; and
memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-9.
CN202111087222.8A 2021-09-16 2021-09-16 Webpage application processing method and device, storage medium and electronic equipment Pending CN113806650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111087222.8A CN113806650A (en) 2021-09-16 2021-09-16 Webpage application processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111087222.8A CN113806650A (en) 2021-09-16 2021-09-16 Webpage application processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113806650A true CN113806650A (en) 2021-12-17

Family

ID=78941298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111087222.8A Pending CN113806650A (en) 2021-09-16 2021-09-16 Webpage application processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113806650A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827231A (en) * 2022-04-11 2022-07-29 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on local storage of browser

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240776A (en) * 2018-07-20 2019-01-18 上海斐讯数据通信技术有限公司 A kind of duplicate method for closing of webpage and system
CN111199003A (en) * 2019-12-25 2020-05-26 深圳市科漫达智能管理科技有限公司 Multi-webpage window management method and device and terminal equipment
CN111538601A (en) * 2020-04-14 2020-08-14 北京宝兰德软件股份有限公司 Webpage end communication method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240776A (en) * 2018-07-20 2019-01-18 上海斐讯数据通信技术有限公司 A kind of duplicate method for closing of webpage and system
CN111199003A (en) * 2019-12-25 2020-05-26 深圳市科漫达智能管理科技有限公司 Multi-webpage window management method and device and terminal equipment
CN111538601A (en) * 2020-04-14 2020-08-14 北京宝兰德软件股份有限公司 Webpage end communication method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827231A (en) * 2022-04-11 2022-07-29 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on local storage of browser
CN114827231B (en) * 2022-04-11 2023-09-26 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on browser local storage

Similar Documents

Publication Publication Date Title
US11868591B2 (en) Dynamic user interface customization
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
US10872127B2 (en) Method and system of providing for cross-device operations between user devices
US10353718B2 (en) Providing access to a remote application via a web client
US20130066947A1 (en) System and Method for Managing Applications for Multiple Computing Endpoints and Multiple Endpoint Types
WO2021223752A1 (en) Display method and apparatus, and electronic device
CN112260853B (en) Disaster recovery switching method and device, storage medium and electronic equipment
CN111694629A (en) Information display method and device and electronic equipment
CN113312119B (en) Information synchronization method and device, computer readable storage medium and electronic equipment
CN113806650A (en) Webpage application processing method and device, storage medium and electronic equipment
US20230409814A1 (en) Document editing method and apparatus, device, and storage medium
CN112507259A (en) Webpage loading method and device, electronic equipment and storage medium
US10452727B2 (en) Method and system for dynamically providing contextually relevant news based on an article displayed on a web page
CN110618811B (en) Information presentation method and device
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN108289056B (en) Method and device for sharing dynamic chart and computing equipment
CN115563134A (en) Interaction method, interaction device, electronic equipment and computer readable medium
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113568695A (en) Corner mark processing method and device for boarder application
CN112346741A (en) Method and device for positioning target page after awakening APP based on H5 external link, electronic equipment and storage medium
CN111090485B (en) Multi-cluster-oriented help data processing method and device, medium and equipment
CN113542335A (en) Information sharing method and device, electronic equipment and storage medium
CN110795670A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN111767111A (en) Page data processing method and device, electronic equipment and storage medium
CN112306324B (en) Information processing method, apparatus, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination