A method, device, and storage medium for maintaining page state based on inline frames.
By generating a new inline frame and utilizing the parent container to monitor its return events and history stack, the problem of losing the original page state during page navigation is solved, achieving state preservation and improved user experience.
Patent Information
- Application Number
- CN202411221539.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-09-02
AI Technical Summary
In traditional web applications, the original page state cannot be maintained when redirecting, leading to increased development costs and a decline in user experience.
By determining the original inline frame, generating a new inline frame while keeping the original inline frame's state unchanged, and using the parent container to monitor the new inline frame's return events and history stack, the system determines whether to close the new inline frame based on the monitoring results, thus ensuring the consistency of the page state.
It maintains the original state of the inline frame, provides flexible control over the display of the inline frame, accurately monitors the frame status, and improves the user experience.
Smart Images

Figure CN119166935B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of inline frames, and more particularly to a method, device, and storage medium for maintaining page state based on inline frames. Background Technology
[0002] In traditional web applications, navigation between different pages is often achieved by retrieving the URL (Uniform Resource Locator) address of inline frames. However, this method suffers from the problem of page state not being saved when the user returns to the previous page through the browser. This not only increases development costs but also negatively impacts the user experience due to resource reloading.
[0003] Therefore, how to maintain the original page state when redirecting to another page has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a method, device, and storage medium for maintaining page state based on inline frames, in order to solve the following technical problem: how to maintain the page state of the original page when jumping to a new page.
[0005] In a first aspect, embodiments of this application provide a method for maintaining page state based on inline frames, characterized in that the method includes: determining the original inline frame; generating a new inline frame based on the selection of the original inline frame, while maintaining the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame; establishing a connection between the new inline frame and a preset parent container; wherein the parent container can open and close the new inline frame; based on the parent container, monitoring the return events and historical stacks of the new inline frame according to a preset monitoring order, and determining whether the new inline frame is closed based on the return events and historical stacks; when the return events and historical stacks of the new inline frame cannot be monitored, monitoring the return events of the original page corresponding to the new inline frame, and determining whether the new inline frame is closed based on the URL change status of the new inline frame; and displaying the original inline frame after the new inline frame is closed.
[0006] In one implementation of this application, after establishing a connection between the new inline frame and the preset parent container, the method further includes: the parent container sending a unique ID to the new inline frame.
[0007] In one implementation of this application, based on the parent container, the return event and history stack of the new inline frame are monitored according to a preset monitoring order, and it is determined whether the new inline frame is closed based on the return event and history stack. Specifically, this includes: monitoring the return event of the new inline frame based on the parent container, and determining whether the new content frame closes the new inline frame based on the return event of the new inline frame; when the return event of the new inline frame cannot be monitored, the history stack of the new inline page is retrieved, and the number of elements in the history stack is used to determine whether the new inline frame is closed; when the history stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and the changes in the navigation array are used to determine whether the new inline frame is closed.
[0008] In one implementation of this application, the method involves monitoring the return event of the new inline frame based on the parent container, and determining whether the new content frame should close the new inline frame based on the return event of the new inline frame. Specifically, this includes: monitoring the return event of the new inline frame based on the parent container; closing the new inline frame when a return event is detected; and maintaining the state of the new inline frame when no return event can be detected.
[0009] In one implementation of this application, when the return event of the new inline frame cannot be detected, the historical stack of the new inline page is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame. This includes: obtaining the historical stack of the new inline frame based on the parent container; when the historical stack can be retrieved, determining whether to close the new inline frame based on the number of elements in the historical stack; when the historical stack cannot be retrieved, the parent container sends a transfer command to the new inline frame, and the historical stack is obtained based on the transfer command; wherein, the transfer command enables the new inline frame to actively send the historical stack to the parent container.
[0010] In one implementation of this application, when the historical stack can be retrieved, a decision is made on whether to close the new inline frame based on the number of elements in the historical stack. Specifically, this includes: closing the new inline frame when the number of elements in the historical stack increases; and maintaining the new inline frame when the historical stack remains unchanged.
[0011] In one implementation of this application, when the historical stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and the change status of the navigation array is used to determine whether to close the new inline frame. Specifically, this includes: when the new inline frame is opened, obtaining a first navigation array; wherein the first navigation array is the navigation array obtained when the new inline frame is first opened; when the new inline frame triggers a back operation, obtaining second navigation data; wherein the second navigation array is the navigation array when the new inline frame triggers a back operation; comparing the first navigation array and the second navigation array to determine whether to close the new inline frame.
[0012] In one implementation of this application, when the return event and history stack of the new inline frame cannot be monitored, the return event of the original page corresponding to the new inline frame is monitored, and the URL change of the new inline frame is used to determine whether to close the new inline frame. Specifically, this includes: detecting the return event of the new inline frame itself to obtain the URL of the new inline frame; comparing the URL of the first time the new inline frame was opened with the URL of the return event; if the URL of the new inline frame and the URL of the return event are the same, the new inline frame is closed based on the parent container.
[0013] Secondly, embodiments of this application also provide a page state maintenance device based on inline frames, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: determine the original inline frame; generate a new inline frame based on the selection of the original inline frame, while maintaining the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame; establish a connection between the new inline frame and a preset parent container; wherein the parent container can open and close the new inline frame; based on the parent container, monitor the return events and history stacks of the new inline frame according to a preset monitoring order, and determine whether the new inline frame is closed based on the return events and history stacks; when the return events and history stacks of the new inline frame cannot be monitored, monitor the return events of the original page corresponding to the new inline frame, and determine whether the new inline frame is closed based on the URL change status of the new inline frame; when the new inline frame is closed, display the original inline frame.
[0014] Thirdly, embodiments of this application also provide a non-volatile computer storage medium for maintaining page state based on inline frames, storing computer-executable instructions, characterized in that the computer-executable instructions are configured to: determine the original inline frame; generate a new inline frame based on the selection of the original inline frame, while maintaining the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame; establish a connection between the new inline frame and a preset parent container; wherein the parent container can open and close the new inline frame; based on the parent container, monitor the return events and history stacks of the new inline frame according to a preset monitoring order, and determine whether the new inline frame is closed based on the return events and history stacks; when the return events and history stacks of the new inline frame cannot be monitored, monitor the return events of the original page corresponding to the new inline frame, and determine whether to close the new inline frame based on the URL change status of the new inline frame; when the new inline frame is closed, display the original inline frame.
[0015] The page state maintenance method, device, and storage medium based on inline frames provided in this application have at least the following technical effects:
[0016] Maintain the state of the original inline frame: When creating a new inline frame, ensure that the state of the original inline frame (such as scroll position, form input, etc.) is not lost or changed. This way, when the user returns from the new inline frame to the original inline frame, they will see a consistent user interface and experience.
[0017] Flexible control over inline frame display: By controlling the opening and closing of new inline frames through the parent container, more flexible and dynamic content display can be achieved. The parent container can trigger the display or hiding of new inline frames based on user actions, application logic, or other events.
[0018] Accurate monitoring of inline frame status: The parent container can monitor the return events and history stacks of new inline frames according to a preset monitoring order. This allows applications to accurately determine the status of new inline frames, such as whether they should be closed and when the original inline frames should be displayed.
[0019] Handling complex situations such as cross-domain issues: When events of the new inline frame cannot be directly monitored (e.g., due to cross-domain restrictions), the application can instead monitor the return event of the original page corresponding to the new inline frame and determine the state of the new inline frame by observing URL changes. This ensures that even in complex situations, the application can correctly handle the interaction logic of the inline frame.
[0020] Improved User Experience: By employing the above methods, applications can provide a smoother and more consistent user experience. Users can seamlessly switch between different inline frames without losing context or encountering inconsistent interface states. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 A flowchart illustrating a page state maintenance method based on inline frames, provided for embodiments of this application;
[0023] Figure 2 This is a schematic diagram of the internal structure of a page state retention device based on inline frames, provided as an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] This application provides a method, device, and storage medium for maintaining page state based on inline frames, in order to solve the following technical problem: how to maintain the page state of the original page when jumping to a new page.
[0026] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0027] Figure 1 This document provides a flowchart illustrating a page state maintenance process based on inline frames, as exemplified in this application. Figure 1 As shown in the figure, the page state maintenance method based on inline frames provided in this application embodiment specifically includes the following steps:
[0028] Step 1: Determine the original inline frame, generate a new inline frame based on the selection of the original inline frame, and keep the state of the original inline frame unchanged; wherein, the new inline frame can completely cover the original inline frame.
[0029] The original inline frame is the inline frame that exists on the current page. When a user performs a preset action (clicks a preset new page link), a new inline frame will be created. In other words, the new inline frame can specify the src attribute of the new inline frame, pointing to the URL of the content to be loaded.
[0030] To maintain the style of the new inline frame to a certain extent, you can set its properties to ensure it completely overrides the original inline frame. To preserve the state of the original inline frame:
[0031] Before creating a new inline frame, the state of the original inline frame needs to be recorded. This state includes, but is not limited to, scroll position, form field values, currently displayed page, and video playback progress. When the new inline frame is closed and the original inline frame needs to be redisplayed, its original state should be displayed directly.
[0032] Understandably, multiple new inline frames can be created within a single page. To differentiate between these multiple new inline frames and precisely close a specific one, the following methods can be used:
[0033] The parent container sends a unique ID to the new inline frame.
[0034] The parent container can generate a unique ID, which is usually a string and can be a UUID (Universally Unique Identifier) or any other format that ensures uniqueness.
[0035] When a parent container creates a new inline frame, it can pass this unique ID as part of the URL parameter to the new inline frame's src attribute. Alternatively, if the content of the new inline frame is from the same origin as the parent container (i.e., from the same domain), the parent container can directly access the new inline frame's contentWindow property via JavaScript and store the unique ID in a global variable or a specific DOM element.
[0036] The content loaded by the new inline frame can be parsed to extract the unique ID passed. If the ID is passed as a URL parameter, then the content of the new inline frame needs to parse this parameter during loading.
[0037] Once the new inline frame receives a unique ID, it can use that ID to send requests to the server, update its internal state, or communicate with other inline frames.
[0038] Step 2: Connect the new inline frame to the preset parent container; the parent container can open and close the new inline frame.
[0039] The parent container is an HTML element, usually a div, which acts as the container for the new inline frame. Inserting the new inline frame into the parent container: In specific cases, this can be done using JavaScript to insert the DOM element of the new inline frame into the DOM element of the parent container.
[0040] The parent container can open and close new inline frames.
[0041] The open function can be implemented by simply displaying a new inline frame (e.g., by setting its display style to block); the close function can be implemented by hiding the new inline frame (e.g., by setting its display style to none).
[0042] These functions can be bound to event listeners on the parent container so that they can be triggered when the user interacts with them.
[0043] Step 3: Based on the parent container, monitor the return events and historical stacks of the new inline frame in a preset monitoring order, and determine whether the new inline frame is closed based on the return events and historical stacks.
[0044] Step 31: Monitor the return event of the new inline frame based on the parent container, and determine whether the new content frame should close the new inline frame based on the return event of the new inline frame.
[0045] First, monitor the return events of the new inline frame based on the parent container.
[0046] The parent container sets an event listener for the new inline frame to listen for back events (such as clicking the browser's back button).
[0047] Furthermore, when a new inline frame triggers a return event, the new inline frame is closed.
[0048] The parent container attempts to retrieve the browser history stack of the new inline frame. This can be achieved using the JavaScript window.history object, but in practice, due to browser protocol restrictions, direct access to the history stack by the parent container is limited, making it difficult to actively retrieve return events.
[0049] When a return event can be detected, close the new inline frame.
[0050] Furthermore, maintain the state of the new inline frame when a return event cannot be detected.
[0051] Step 32: When the return event of the new inline frame cannot be detected, retrieve the history stack of the new inline page and determine whether to close the new inline frame based on the number of elements in the history stack.
[0052] First, the historical stack of the new inline frame is obtained from the parent container. Then, if the historical stack can be retrieved, the number of elements in the historical stack determines whether to close the new inline frame. Furthermore, if the historical stack cannot be retrieved, the parent container sends a transfer command to the new inline frame, and the historical stack is obtained based on the transfer command; the transfer command enables the new inline frame to actively send its historical stack to the parent container. When the number of elements in the historical stack increases, the new inline frame is closed; when the historical stack remains unchanged, the new inline frame is maintained.
[0053] When the history stack is available, the parent container should determine whether to close the new inline frame based on the number of elements in the history stack. If the number of elements in the history stack increases (indicating that the user has navigated to a new page), the new inline frame is closed. If the history stack remains unchanged, the new inline frame remains open.
[0054] Step 33: When the history stack of the new inline page cannot be retrieved, retrieve the navigation array of the new inline page, and determine whether to close the new inline frame based on the changes in the navigation array.
[0055] First, when a new inline frame opens, the first navigation array is obtained; this first navigation array is the navigation array obtained when the new inline frame is first opened. When a new inline frame opens, the parent container obtains an initial navigation array (representing the current browser window's session history).
[0056] Furthermore, when the new inline frame triggers a return operation, the second navigation data is obtained; wherein, the second navigation array is the navigation array when the new inline frame triggers a return operation.
[0057] When the new inline frame triggers a return operation, the parent container retrieves the navigation array again.
[0058] Furthermore, the first and second navigation arrays are compared to determine whether to close the new inline frame. The navigation array initially opened is compared to the navigation array at the time of the back operation. If the navigation array has changed (indicating user navigation), the new inline frame is closed. If it has not changed, the new inline frame remains open.
[0059] Step 4: When it is impossible to monitor the return event and history stack of the new inline frame, monitor the return event of the original page corresponding to the new inline frame, and determine whether to close the new inline frame based on the URL change status of the new inline frame.
[0060] First, detect the return event of the new inline frame itself to obtain the URL of the new inline frame. The parent container sets an event listener for the new inline frame or its internal components to listen for the URL of the return event.
[0061] Furthermore, the URL of the first time the new inline frame is opened is compared with the URL of the return event. If the URL of the new inline frame and the URL of the return event are the same, the new inline frame is closed based on the parent container.
[0062] If the current URL of the new inline frame is the same as the URL when it was first opened, this indicates that the user has navigated back to the original page, and the new inline frame can be closed.
[0063] Step 5: After closing the new inline frame, the original inline frame will be displayed.
[0064] The above are embodiments of the method proposed in this application. Based on the same inventive concept, embodiments of this application also provide a page state maintenance device based on inline frames, the structure of which is as follows: Figure 2 As shown.
[0065] Figure 2 This is a schematic diagram of the internal structure of a page state persistence device based on inline frames, provided as an embodiment of this application. Figure 2 As shown, the device includes:
[0066] At least one processor 201;
[0067] And a memory 202 that is communicatively connected to at least one processor;
[0068] The memory 202 stores instructions executable by at least one processor, which are executed by at least one processor 201 to enable at least one processor 201 to:
[0069] The process involves determining the original inline frame, generating a new inline frame based on the original inline frame selection, and maintaining the original inline frame's state unchanged; the new inline frame must completely cover the original inline frame; establishing a connection between the new inline frame and a preset parent container; the parent container must be able to open and close the new inline frame; based on the parent container, monitoring the new inline frame's return events and historical stack according to a preset monitoring order, and determining whether to close the new inline frame based on the return events and historical stack; when the new inline frame's return events and historical stack cannot be monitored, monitoring the return events of the original page corresponding to the new inline frame, and determining whether to close the new inline frame based on the URL change status of the new inline frame; after closing the new inline frame, displaying the original inline frame.
[0070] Some embodiments of this application provide corresponding to Figure 1 A non-volatile computer storage medium based on inline frames for maintaining page state, storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0071] The process involves determining the original inline frame, generating a new inline frame based on the original inline frame selection, and maintaining the original inline frame's state unchanged; the new inline frame must completely cover the original inline frame; establishing a connection between the new inline frame and a preset parent container; the parent container must be able to open and close the new inline frame; based on the parent container, monitoring the new inline frame's return events and historical stack according to a preset monitoring order, and determining whether to close the new inline frame based on the return events and historical stack; when the new inline frame's return events and historical stack cannot be monitored, monitoring the return events of the original page corresponding to the new inline frame, and determining whether to close the new inline frame based on the URL change status of the new inline frame; after closing the new inline frame, displaying the original inline frame.
[0072] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for IoT devices and media are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0073] The systems, media, and methods provided in this application are one-to-one correspondences. Therefore, the systems and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the systems and media will not be repeated here.
[0074] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0075] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0076] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0077] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0078] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0079] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0080] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0081] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0082] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for maintaining page state based on inline frames, characterized in that, The method includes: The original inline frame is determined, and a new inline frame is generated based on the selection of the original inline frame, while keeping the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame. The new inline frame is connected to a preset parent container; wherein the parent container can open and close the new inline frame. Based on the parent container, the return events and historical stacks of the new inline frame are monitored in a preset monitoring order, and it is determined whether the new inline frame is closed based on the return events and historical stacks. When it is impossible to monitor the return event and history stack of the new inline frame, monitor the return event of the original page corresponding to the new inline frame, and determine whether to close the new inline frame based on the URL change status of the new inline frame. When the new inline frame is closed, the original inline frame is displayed. Based on the parent container, the return events and historical stacks of the new inline frame are monitored according to a preset monitoring order, and the closure of the new inline frame is determined based on the return events and historical stacks. Specifically, this includes: The parent container monitors the return event of the new inline frame and determines whether the parent container should close the new inline frame based on the return event of the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame. When the history stack of the new inline frame cannot be retrieved, the navigation array of the new inline frame is retrieved, and the change status of the navigation array is used to determine whether to close the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame, including: Obtain the historical stack of the new inline frame based on the parent container; When the history stack can be retrieved, determine whether to close the new inline frame based on the number of elements in the history stack. When the historical stack cannot be retrieved, the parent container sends a transfer instruction to the new inline frame to retrieve the historical stack based on the transfer instruction; wherein, the transfer instruction enables the new inline frame to actively send the historical stack to the parent container. When the historical stack can be retrieved, a decision is made based on the number of elements in the historical stack to determine whether to close the new inline frame, specifically including: When the number of historical stacks increases, the new inline frame is closed; The new inline frame is maintained while the history stack remains unchanged.
2. The page state maintenance method based on inline frames according to claim 1, characterized in that, After establishing a connection between the new inline frame and the preset parent container, the method further includes: The parent container sends a unique ID to the new inline frame.
3. The page state maintenance method based on inline frames according to claim 1, characterized in that, Based on the parent container monitoring the return event of the new inline frame, and based on the return event of the new inline frame, determining whether the parent container should close the new inline frame, specifically includes: The parent container is used to monitor the return events of the new inline frame; When a return event is detected that the new inline frame has been triggered, the new inline frame is closed. When the return event cannot be detected, maintain the state of the new inline frame.
4. The page state maintenance method based on inline frames according to claim 1, characterized in that, When the historical stack of the new inline frame cannot be retrieved, the navigation array of the new inline frame is retrieved, and the changes in the navigation array are used to determine whether to close the new inline frame. Specifically, this includes: When the new inline frame is opened, a first navigation array is obtained; wherein, the first navigation array is the navigation array obtained when the new inline frame is opened for the first time; When the new inline frame triggers a return operation, the second navigation array is obtained; wherein, the second navigation array is the navigation array when the new inline frame triggers a return operation; Compare the first navigation array and the second navigation array to determine whether to close the new inline frame.
5. The page state maintenance method based on inline frames according to claim 1, characterized in that, When the return event and history stack of the new inline frame cannot be monitored, the return event of the original page corresponding to the new inline frame is monitored, and the URL change status of the new inline frame is used to determine whether to close the new inline frame, specifically including: Detect the return event of the new inline frame itself to obtain the URL of the new inline frame; Compare the URL of the first time the new inline frame is opened with the URL of the return event; If the URL of the new inline frame is the same as the URL of the returned event, then the new inline frame is closed based on the parent container.
6. A page state persistence device based on inline frames, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: The original inline frame is determined, and a new inline frame is generated based on the selection of the original inline frame, while keeping the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame. The new inline frame is connected to a preset parent container; wherein the parent container can open and close the new inline frame. Based on the parent container, the return events and historical stacks of the new inline frame are monitored in a preset monitoring order, and it is determined whether the new inline frame is closed based on the return events and historical stacks. When it is impossible to monitor the return event and history stack of the new inline frame, monitor the return event of the original page corresponding to the new inline frame, and determine whether to close the new inline frame based on the URL change status of the new inline frame. When the new inline frame is closed, the original inline frame is displayed. Based on the parent container, the return events and historical stacks of the new inline frame are monitored according to a preset monitoring order, and the closure of the new inline frame is determined based on the return events and historical stacks. Specifically, this includes: The parent container monitors the return event of the new inline frame and determines whether the parent container should close the new inline frame based on the return event of the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame. When the history stack of the new inline frame cannot be retrieved, the navigation array of the new inline frame is retrieved, and the change status of the navigation array is used to determine whether to close the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame, including: Obtain the historical stack of the new inline frame based on the parent container; When the history stack can be retrieved, determine whether to close the new inline frame based on the number of elements in the history stack. When the historical stack cannot be retrieved, the parent container sends a transfer instruction to the new inline frame to retrieve the historical stack based on the transfer instruction; wherein, the transfer instruction enables the new inline frame to actively send the historical stack to the parent container. When the historical stack can be retrieved, a decision is made based on the number of elements in the historical stack to determine whether to close the new inline frame, specifically including: When the number of historical stacks increases, the new inline frame is closed; The new inline frame is maintained while the history stack remains unchanged.
7. A non-volatile computer storage medium based on inline frames for maintaining page state, storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: The original inline frame is determined, and a new inline frame is generated based on the selection of the original inline frame, while keeping the state of the original inline frame unchanged; wherein the new inline frame can completely cover the original inline frame. The new inline frame is connected to a preset parent container; wherein the parent container can open and close the new inline frame. Based on the parent container, the return events and historical stacks of the new inline frame are monitored in a preset monitoring order, and it is determined whether the new inline frame is closed based on the return events and historical stacks. When it is impossible to monitor the return event and history stack of the new inline frame, monitor the return event of the original page corresponding to the new inline frame, and determine whether to close the new inline frame based on the URL change status of the new inline frame. When the new inline frame is closed, the original inline frame is displayed. Based on the parent container, the return events and historical stacks of the new inline frame are monitored according to a preset monitoring order, and the closure of the new inline frame is determined based on the return events and historical stacks. Specifically, this includes: The parent container monitors the return event of the new inline frame and determines whether the parent container should close the new inline frame based on the return event of the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame. When the history stack of the new inline frame cannot be retrieved, the navigation array of the new inline frame is retrieved, and the change status of the navigation array is used to determine whether to close the new inline frame. When the return event of the new inline frame cannot be detected, the historical stack of the new inline frame is retrieved, and the number of elements in the historical stack is used to determine whether to close the new inline frame, including: Obtain the historical stack of the new inline frame based on the parent container; When the history stack can be retrieved, determine whether to close the new inline frame based on the number of elements in the history stack. When the historical stack cannot be retrieved, the parent container sends a transfer instruction to the new inline frame to retrieve the historical stack based on the transfer instruction; wherein, the transfer instruction enables the new inline frame to actively send the historical stack to the parent container. When the historical stack can be retrieved, a decision is made based on the number of elements in the historical stack to determine whether to close the new inline frame, specifically including: When the number of historical stacks increases, the new inline frame is closed; The new inline frame is maintained while the history stack remains unchanged.
Citation Information
Patent Citations
Information processing method, browser client and terminal
CN104978385A
Page display method and device and medium
CN116450970A
Page designer and device thereof, storage medium and computing equipment
CN117668403A