Page state keeping method and device based on inline framework and storage medium
By generating a new inline framework and establishing a connection with the parent container, monitoring the return events and history stack, the problem of page status loss when the browser returns is solved, and the page status is maintained and user experience is improved.
Patent Information
- Application Number
- CN202411221539.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Traditional web applications cannot effectively maintain the page status when the user's browser returns to the previous page, resulting in increased development costs and impact on user experience.
By generating a new inline framework, keeping the original inline framework state unchanged, establishing a connection with the preset parent container, monitoring the return events and history stack, and determining whether the new inline framework is closed based on these events, ensuring that the original inline framework is in The status remains consistent when the user returns.
It realizes the function of maintaining the original page state when jumping to the page, provides a smoother and consistent user experience, flexibly controls the display of inline frameworks, and can handle complex situations such as cross-domain.
Smart Images

Figure CN119166935A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of inline frames, and in particular to a method, device and storage medium for maintaining a page state based on an inline frame. Background Art
[0002] In traditional web applications, the jump between different pages is often achieved by obtaining the URL (Uniform Resource Locator) address of the inline frame. However, this method will face the problem that the page state cannot be saved when the user returns to the previous page through the browser. This not only increases the development cost, but also affects the user experience due to reloading resources.
[0003] Therefore, how to keep the page status of the original page when jumping to another page becomes a problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present application provide a method, device and storage medium for maintaining page status based on an inline frame, so as to solve the following technical problem: how to maintain the page status of the original page when jumping to another page.
[0005] In a first aspect, an embodiment of the present application provides a method for maintaining a page state based on an inline frame, characterized in that the method includes: determining an original inline frame, generating a new inline frame based on a selection of the original inline frame, and 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 a return event and a history stack of the new inline frame in a preset monitoring order, and determining whether the new inline frame is closed based on the return event and the history stack; when the return event and the history stack of the new inline frame cannot be monitored, monitoring the return event 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 the new inline frame is closed, displaying the original inline frame.
[0006] In an implementation of the present 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 the present application, based on the parent container, the return event and history stack of the new inline frame are monitored in a preset monitoring order, and based on the return event and the history stack, it is determined whether the new inline frame is closed, specifically including: 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, calling the history stack of the new inline page, and judging whether to close the new inline frame based on the number of elements in the history stack; when the history stack of the new inline page cannot be called, calling the navigation array of the new inline page, and judging whether to close the new inline frame based on the change status of the navigation array.
[0008] In one implementation of the present application, a return event of a new inline frame is monitored based on a parent container, and based on the return event of the new inline frame, it is determined whether the new content frame closes the new inline frame, specifically including: monitoring the return event of the new inline frame based on the parent container; when it is detected that the new inline frame triggers a return event, closing the new inline frame; when the return event cannot be detected, maintaining the state of the new inline frame.
[0009] In one implementation of the present application, when a return event of a new inline frame cannot be monitored, a history stack of the new inline page is retrieved, and whether to close the new inline frame is determined based on the number of elements in the history stack, including: obtaining the history stack of the new inline frame based on a parent container; when the history stack can be retrieved, determining whether to close the new inline frame based on the number of elements in the history stack; when the history stack cannot be retrieved, the parent container sends a transfer instruction to the new inline frame, and obtains the history stack based on the transfer instruction; wherein the transfer instruction enables the new inline frame to actively send the history stack to the parent container.
[0010] In one implementation of the present application, when the history stack can be called, whether to close the new inline frame is determined based on the number of elements in the history stack, specifically including: when the number of history stacks increases, closing the new inline frame; when the history stack remains unchanged, keeping the new inline frame.
[0011] In one implementation of the present application, when the history stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and whether to close the new inline frame is determined based on the change in the navigation array, specifically including: 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 return operation, obtaining second navigation data; wherein the second navigation array is the navigation array when the new inline frame triggers a return operation; and comparing the first navigation array and the second navigation array to determine whether to close the new inline frame.
[0012] In one implementation of the present 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 whether to close the new inline frame is determined based on the change status of the URL of the new inline frame, which specifically 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 opening of the new inline frame 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, closing the new inline frame based on the parent container.
[0013] In a second aspect, an embodiment of the present application further provides a page state maintaining device based on an inline frame, characterized in that the device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: 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; 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 event and history stack of the new inline frame in a preset monitoring order, and determine whether the new inline frame is closed based on the return event and history stack; when the return event and history stack of the new inline frame cannot be monitored, 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; after the new inline frame is closed, display the original inline frame.
[0014] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium for maintaining the page state based on an inline frame, storing computer executable instructions, characterized in that the computer executable instructions are configured to: determine an 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; 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 event and history stack of the new inline frame in a preset monitoring order, and determine whether the new inline frame is closed based on the return event and history stack; when the return event and history stack of the new inline frame cannot be monitored, 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; after the new inline frame is closed, display the original inline frame.
[0015] The embodiments of the present application provide a method, device and storage medium for maintaining page status based on an inline frame, which have at least the following technical effects:
[0016] Maintain the state of the original iframe: When creating a new iframe, ensure that the state of the original iframe (such as scroll position, form input, etc.) is not lost or changed. In this way, when the user returns from the new iframe to the original iframe, they can see a consistent user interface and experience.
[0017] Flexible control of inline frame display: By controlling the opening and closing of new inline frames through parent containers, 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 operations, application logic, or other events.
[0018] Accurately monitor the state of the iframe: The parent container can monitor the return event and history stack of the new iframe in a preset monitoring order. This allows the application to accurately determine the state of the new iframe, such as whether it should be closed and when the original iframe should be displayed.
[0019] Handling complex situations such as cross-domain: When it is impossible to directly monitor the events of the new inline frame (such as due to cross-domain restrictions), the application can monitor the return events of the original page corresponding to the new inline frame and determine the status of the new inline frame by observing the URL changes. This ensures that even in complex situations, the application can correctly handle the interaction logic of the inline frame.
[0020] Improve user experience: Through the above processing, the application can provide a smoother and more consistent user experience. Users can switch seamlessly between different inline frames without losing context or encountering inconsistent interface states. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 A flow chart of a method for maintaining page status based on an iframe provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of the internal structure of a page state retention device based on an iframe provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0025] The embodiments of the present application provide a method, device and storage medium for maintaining page status based on an inline frame, so as to solve the following technical problem: how to maintain the page status of the original page when jumping to another page.
[0026] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0027] Figure 1 A flow chart of maintaining page status based on an inline frame is provided in an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a method for maintaining page status based on an inline frame, which 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 existing in the current page. When the user initiates the preset operation (clicks the preset new page link), a new inline frame, i.e., a new inline frame, can be created. It can be understood that the src attribute of the new inline frame can be formulated to point to the URL of the content to be loaded.
[0030] In order to ensure the style of the new inline frame to a certain extent, you can set the properties of the new inline frame to ensure that the new inline frame can completely cover the original inline frame. Keep the status of the original inline frame:
[0031] Before creating a new inline frame, the state of the original inline frame needs to be recorded. The state of the original inline frame includes but is not limited to the scroll position, the value of the form field, the currently displayed page, the video playback progress, etc. When the new inline frame is closed and the original inline frame needs to be redisplayed, the state of the original inline frame can be directly displayed.
[0032] It is understandable that multiple new inline frames can be created in one page. In order to distinguish multiple new inline frames and accurately close the specified new inline frames, it can be handled in the following ways:
[0033] The parent container sends a unique ID to the new iframe.
[0034] The parent container can generate a unique ID, which is usually a string, which can be a UUID (Universally Unique Identifier) or any other format that ensures uniqueness.
[0035] When the parent container creates the new iframe, the parent container can pass this unique ID as part of the URL parameters to the src attribute of the new iframe. Or, if the content of the new iframe is of the same origin as the parent container (i.e., from the same domain), the parent container can directly access the contentWindow property of the new iframe through JavaScript and store the unique ID in a global variable or a specific DOM element.
[0036] The content loaded by the new iframe is able to resolve the unique ID passed in. If the ID is passed as a URL parameter, the content of the new iframe needs to resolve this parameter when it loads.
[0037] Once the new iframe receives the unique ID, the new iframe can use the ID to send requests to the server, update its internal state, or communicate with other iframes.
[0038] Step 2: 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.
[0039] The parent container is an HTML element, usually a div, which serves as a container for the new iframe. Insert the new iframe into the parent container: In a specific case, the DOM element of the new iframe can be inserted into the DOM element of the parent container through JavaScript.
[0040] The parent container is able to open and close the new iframe.
[0041] The opening function may be achieved by simply displaying the new iframe (eg, by setting its display style to block); the closing function may be achieved by hiding the new iframe (eg, by setting its display style to none).
[0042] These functions can be bound to event listeners on the parent container so that they are triggered upon user interaction.
[0043] Step 3: Based on the parent container, the return event and history stack of the new inline frame are monitored in a preset monitoring order, and based on the return event and the history stack, it is determined whether the new inline frame is closed.
[0044] Step 31: Monitor the return event of the new inline frame based on the parent container, and determine whether the new content frame closes the new inline frame based on the return event of the new inline frame.
[0045] First, monitor the return event of the new iframe based on the parent container.
[0046] The parent container sets an event listener for the new inline frame to listen for return events (such as a browser back button click).
[0047] Further, when it is detected that the new inline frame triggers a return event, the new inline frame is closed.
[0048] The parent container attempts to obtain the browser history stack of the new inline frame. This can be achieved through the JavaScript window.history object, but in the actual operation, the browser is restricted from directly accessing the history stack due to protocol reasons, so it is difficult to actively obtain the return event.
[0049] When a return event is detected, close the new iframe.
[0050] Furthermore, when the return event cannot be detected, the state of the new inline frame is maintained.
[0051] Step 32: When the return event of the new inline frame cannot be detected, the history stack of the new inline page is retrieved, and the number of elements in the history stack is used to determine whether to close the new inline frame.
[0052] First, the history stack of the new inline frame is obtained based on the parent container. Further, when the history stack can be retrieved, it is determined whether to close the new inline frame based on the number of elements in the history stack. Further, when the history stack cannot be retrieved, the parent container sends a transfer instruction to the new inline frame, and obtains the history stack based on the transfer instruction; wherein the transfer instruction enables the new inline frame to actively send the history stack to the parent container. When the number of history stacks increases, the new inline frame is closed; when the history stack remains unchanged, the new inline frame is kept.
[0053] When the history stack is available, the parent container should decide whether to close the new iframe based on the number of elements in the history stack. If the history stack increases (indicating that the user has navigated to a new page), close the new iframe. If the history stack remains the same, keep the new iframe open.
[0054] Step 33: When the history stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and whether to close the new inline frame is determined based on the change status of the navigation array.
[0055] First, when a new inline frame is opened, a first navigation array is obtained; wherein the first navigation array is a navigation array obtained when a new inline frame is first opened. When a new inline frame is opened, the parent container obtains an initial navigation array (representing the session history of the current browser window).
[0056] Further, when the new inline frame triggers a return operation, second navigation data is obtained; wherein the second navigation array is a navigation array when the new inline frame triggers a return operation.
[0057] When the new iframe triggers the back action, the parent container gets the navigation array again.
[0058] Furthermore, the first navigation array and the second navigation array are compared to determine whether to close the new inline frame. The navigation array opened for the first time and the navigation array during the return operation are compared. If the navigation array changes (indicating that the user has navigated), the new inline frame is closed. If there is no change, the new inline frame remains open.
[0059] Step 4: When the return event and history stack of the new inline frame cannot be monitored, the return event of the new inline frame corresponding to the original page is monitored, and whether to close the new inline frame is determined 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 internals to listen for the URL of the return event.
[0061] Furthermore, the URL of the first opening of the new inline frame is compared with the URL of the return event. If the URL of the new inline frame is the same as the URL of the return event, the new inline frame is closed based on the parent container.
[0062] If the current URL of the new iframe 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 iframe can be closed.
[0063] Step 5: After closing the new inline frame, the original inline frame is displayed.
[0064] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, the embodiment of this application also provides a page state retention device based on an iframe, and its structure is as follows: Figure 2 shown.
[0065] Figure 2 The following is a schematic diagram of the internal structure of a page state retention device based on an iframe provided in an embodiment of the present application. Figure 2 As shown, the device includes:
[0066] at least one processor 201;
[0067] and, a memory 202 communicatively connected to the at least one processor;
[0068] The memory 202 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 201 to enable at least one processor 201 to:
[0069] The original inline frame is determined, and a new inline frame is generated based on the selection of the original inline frame, and the state of the original inline frame is kept 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 event and the history stack of the new inline frame are monitored in accordance with a preset monitoring sequence, and whether the new inline frame is closed is determined based on the return event and the history stack; when the return event and the 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 whether the new inline frame is closed is determined based on the URL change status of the new inline frame; after the new inline frame is closed, the original inline frame is displayed.
[0070] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium based on inline frame page state retention stores computer executable instructions, wherein the computer executable instructions are set to:
[0071] The original inline frame is determined, and a new inline frame is generated based on the selection of the original inline frame, and the state of the original inline frame is kept 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 event and the history stack of the new inline frame are monitored in accordance with a preset monitoring sequence, and whether the new inline frame is closed is determined based on the return event and the history stack; when the return event and the 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 whether the new inline frame is closed is determined based on the URL change status of the new inline frame; after the new inline frame is closed, the original inline frame is displayed.
[0072] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0073] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0074] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0075] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0076] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0077] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions 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] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0080] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0081] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0082] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A page state preservation method based on an inline frame, characterized in that: The method comprises: Determine an original iframe, generate a new iframe based on the selection of the original iframe, and keep the state of the original iframe unchanged; wherein the new iframe can completely cover the original iframe; 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 event and history stack of the new inline frame in a preset monitoring order, and determining whether the new inline frame is closed based on the return event and history stack; 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 whether to close the new inline frame is determined according to the URL change status of the new inline frame; After the new inline frame is closed, the original inline frame is displayed.
2. A method for maintaining page status based on an inline frame according to claim 1, characterized in that: After establishing a connection between the new inline frame and a preset parent container, the method further includes: The parent container sends a unique ID to the new iframe.
3. The method for maintaining page status based on an inline frame according to claim 1, characterized in that: Based on the parent container, monitoring the return event and history stack of the new inline frame in a preset monitoring order, and determining whether the new inline frame is closed based on the return event and the history stack, specifically including: Monitoring a 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 detected, the history stack of the new inline page is retrieved, and the number of elements in the history stack is used to determine whether to close the new inline frame; When the history stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and whether to close the new inline frame is determined based on the change status of the navigation array.
4. The method for maintaining page status based on an inline frame according to claim 3, characterized in that: 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, specifically includes: Monitoring a return event of the new inline frame based on the parent container; When it is detected that the new inline frame triggers a return event, closing the new inline frame; When the return event cannot be detected, the state of the new inline frame is maintained.
5. The method for maintaining page status based on an inline frame according to claim 3, characterized in that: When the return event of the new inline frame cannot be detected, the history stack of the new inline page is retrieved, and the number of elements in the history stack is used to determine whether to close the new inline frame, which includes: Obtaining a history stack of the new inline frame based on the parent container; When the history stack can be retrieved, determining whether to close the new inline frame based on the number of elements in the history stack; When the history stack cannot be retrieved, the parent container sends a transfer instruction to the new iframe, and obtains the history stack based on the transfer instruction; wherein the transfer instruction enables the new iframe to actively send the history stack to the parent container.
6. The method for maintaining page status based on an inline frame according to claim 5, characterized in that: When the history stack can be retrieved, determining whether to close the new inline frame based on the number of elements in the history stack specifically includes: When the number of the history stack increases, closing the new inline frame; The new iframe is maintained while the history stack remains unchanged.
7. The method for maintaining page status based on an inline frame according to claim 1, characterized in that: When the history stack of the new inline page cannot be retrieved, the navigation array of the new inline page is retrieved, and whether to close the new inline frame is determined based on the change status of the navigation array, specifically including: When the new inline frame is opened, a first navigation array is obtained; wherein the first navigation array is a navigation array obtained when the new inline frame is opened for the first time; When the new inline frame triggers a return operation, second navigation data is acquired; wherein the second navigation array is a navigation array when the new inline frame triggers a return operation; The first navigation array and the second navigation array are compared to determine whether to close the new inline frame.
8. The method for maintaining page status based on an inline frame 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 whether to close the new inline frame is determined based on the URL change status of the new inline frame, specifically including: Detecting a return event of the new inline frame itself to obtain the URL of the new inline frame; Comparing the URL of the first opening of the new iframe with the URL of the return event; If the URL of the new iframe is the same as the URL of the return event, the new iframe is closed based on the parent container.
9. A page state holding device based on an inline frame, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Determine an original iframe, generate a new iframe based on the selection of the original iframe, and keep the state of the original iframe unchanged; wherein the new iframe can completely cover the original iframe; 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 event and history stack of the new inline frame in a preset monitoring order, and determining whether the new inline frame is closed based on the return event and history stack; 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 whether to close the new inline frame is determined according to the URL change status of the new inline frame; After the new inline frame is closed, the original inline frame is displayed.
10. A non-volatile computer storage medium for maintaining page state based on an inline frame, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Determine an original iframe, generate a new iframe based on the selection of the original iframe, and keep the state of the original iframe unchanged; wherein the new iframe can completely cover the original iframe; 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 event and history stack of the new inline frame in a preset monitoring order, and determining whether the new inline frame is closed based on the return event and history stack; 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 whether to close the new inline frame is determined according to the URL change status of the new inline frame; After the new inline frame is closed, the original inline frame is displayed.
Citation Information
Patent Citations
Information processing method, browser client and terminal
CN104978385A
Webpage content display method and terminal
CN108664498A
A page jumping method and device
CN109740083A
Page display method and device and medium
CN116450970A
Page designer and device thereof, storage medium and computing equipment
CN117668403A
Cited By
Native return adaptation method, system and equipment for mobile Web application
CN120561399A
Page switching state keeping method and device, equipment and readable storage medium
CN122653743A
Page switching state maintaining method, device, apparatus and readable storage medium
CN122653743B
