Page refreshing method and device, electronic equipment and storage medium
By monitoring the click event of the iframe tag and reloading it within the current page, the problem of refresh failure caused by untimely update of the URL of the internal page of the iframe tag is solved, achieving precise refresh of the internal page and improving the user experience.
Patent Information
- Application Number
- CN202410758736.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-06
AI Technical Summary
When the internal page of the iframe tag is switched multiple times, the URL of the internal page may change, but is not updated synchronously to the src attribute of the iframe tag, causing the refresh to fail when refreshing the external page, reducing the user experience.
Monitor the click event of the iframe tag, store its information in the floating iframe tag list, filter out the target iframe tag (iframe tags corresponding to internal pages that do not include subpages), and execute the reload method in the current page of the target iframe tag to refresh Internal pages.
It achieves precise refreshing of internal pages of iframe tags, improves user experience and ensures the accuracy of refresh operations.
Smart Images

Figure CN118606579A
Abstract
Description
Background Art
[0002] Currently, when it is necessary to refresh the internal page corresponding to the iframe tag, the internal page corresponding to the iframe tag is generally refreshed together by refreshing the external page.
[0003] In this way, after the internal page corresponding to the iframe tag has been switched multiple times, the URL corresponding to the internal page may have changed. However, since the URL of the internal page will not be synchronously updated to the src attribute of the iframe tag, when the internal page is refreshed by refreshing the external page to refresh the internal page corresponding to the iframe tag, it is possible that after the refresh, the internal page corresponding to the src value of the iframe tag is displayed instead of the internal page that actually needs to be refreshed, resulting in a failure to refresh the internal page, thereby reducing the user experience. Summary of the invention
[0004] The embodiments of the present invention provide a page refresh method, device, electronic device and storage medium for realizing the separate refresh of an internal page corresponding to an iframe tag.
[0005] In a first aspect, an embodiment of the present invention provides a page refresh method, the method comprising:
[0006] Listening to a click event for at least one iframe tag, storing information of the at least one iframe tag in a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed;
[0007] Filtering out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list;
[0008] Inside the current page corresponding to the target iframe tag, a local reloading method is executed to refresh the internal page corresponding to the target iframe tag.
[0009] In a possible implementation, before monitoring a click event on at least one iframe tag, the method further includes:
[0010] Obtain the iframe tags corresponding to all internal pages in the current page, and create an iframe tag list based on the iframe tags corresponding to all the internal pages;
[0011] The iframe tag list is traversed, and a monitoring event for the click event is established for each iframe tag respectively; the monitoring event is used to monitor whether the click event is triggered.
[0012] In a possible implementation, before storing the information of the at least one iframe tag into the floating iframe tag list, the method further includes:
[0013] Determine the iframe tag object of each of the at least one iframe tag respectively, and determine whether to store it in the floating iframe tag list based on the iframe tag object;
[0014] The iframe tag object includes identification information for indicating the iframe tag and a parentList attribute for storing identification information of at least one parent page of the internal page corresponding to the iframe tag.
[0015] In a possible implementation, filtering out a target iframe tag from the floating iframe tag list includes:
[0016] Determine the length information of the parentList attribute of each iframe tag in the floating iframe tag list;
[0017] The iframe tag whose parentList attribute length information is smaller than the preset value is used as the target iframe tag.
[0018] In a possible implementation, the method further includes:
[0019] When a cancel event for an iframe tag is monitored, deleting the iframe tag from the suspended iframe tag list; and,
[0020] The subpage of the internal page corresponding to the iframe tag is determined, and the iframe tag corresponding to the subpage is determined, and the parentList attribute of the iframe tag of the subpage is adjusted to obtain an updated floating iframe tag list.
[0021] In a possible implementation, monitoring a click event on at least one iframe tag includes:
[0022] Determine the top-level page among all the internal pages included in the current page, and set a new listening event for listening to the contextmenu event for the top-level page;
[0023] When it is monitored that the contextmenu event is triggered and it is determined that there is an iframe tag in the floating iframe tag list, it is determined that a click event for at least one iframe tag is monitored.
[0024] In a second aspect, an embodiment of the present invention provides a page refresh device, the device comprising:
[0025] The processing unit is used to monitor a click event for at least one iframe tag, and store information of the at least one iframe tag into a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed;
[0026] A screening unit is used to screen out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list;
[0027] The refresh unit is used to execute a local reloading method inside the current page corresponding to the target iframe tag to refresh the internal page corresponding to the target iframe tag.
[0028] In a possible implementation manner, the processing unit is further configured to:
[0029] Obtain the iframe tags corresponding to all internal pages in the current page, and create an iframe tag list based on the iframe tags corresponding to all the internal pages;
[0030] The iframe tag list is traversed, and a monitoring event for the click event is established for each iframe tag respectively; the monitoring event is used to monitor whether the click event is triggered.
[0031] In a possible implementation manner, the processing unit is further configured to:
[0032] Determine the iframe tag object of each of the at least one iframe tag respectively, and determine whether to store it in the floating iframe tag list based on the iframe tag object;
[0033] The iframe tag object includes identification information for indicating the iframe tag and a parentList attribute for storing identification information of at least one parent page of the internal page corresponding to the iframe tag.
[0034] In a possible implementation, the screening unit is specifically used for:
[0035] Determine the length information of the parentList attribute of each iframe tag in the floating iframe tag list;
[0036] The iframe tag whose parentList attribute length information is smaller than the preset value is used as the target iframe tag.
[0037] In a possible implementation manner, the device further includes an updating unit, configured to:
[0038] When a cancel event for an iframe tag is monitored, deleting the iframe tag from the suspended iframe tag list; and,
[0039] The subpage of the internal page corresponding to the iframe tag is determined, and the iframe tag corresponding to the subpage is determined, and the parentList attribute of the iframe tag of the subpage is adjusted to obtain an updated floating iframe tag list.
[0040] In a possible implementation manner, the processing unit is specifically configured to:
[0041] Determine the top-level page among all the internal pages included in the current page, and set a new listening event for listening to the contextmenu event for the top-level page;
[0042] When it is monitored that the contextmenu event is triggered and it is determined that there is an iframe tag in the floating iframe tag list, it is determined that a click event for at least one iframe tag is monitored.
[0043] In a third aspect, an embodiment of the present invention provides an electronic device, comprising 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, and the instructions are executed by the at least one processor so that the at least one processor can execute any method provided in the embodiment of the first aspect of the present invention.
[0044] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any method provided by the embodiment of the first aspect of the present invention.
[0045] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods provided in the embodiment of the first aspect.
[0046] The beneficial effects of the present invention are as follows:
[0047] In an embodiment of the present invention, a click event for at least one iframe tag is monitored, and the information of at least one iframe tag is stored in a floating iframe tag list; the floating iframe tag list is used to store the iframe tags corresponding to the candidate internal pages to be refreshed; the target iframe tag is screened out from the floating iframe tag list; the target iframe tag is the iframe tag corresponding to the internal page that does not include a subpage in the floating iframe tag list. In other words, in an embodiment of the present invention, since there is a one-to-one correspondence between the iframe tag and the internal page, the internal page to be refreshed can be accurately located by screening the target iframe tag, and the local reloading method can be executed inside the current page corresponding to the target iframe tag, thereby achieving the purpose of refreshing the internal page corresponding to the target iframe tag. In other words, the user can selectively refresh a certain internal page of the internal pages included in the current page, achieve accurate refresh of the internal page, and improve the user experience.
[0048] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings introduced below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0050] Figure 1 A schematic diagram of an application scenario in an embodiment of the present invention;
[0051] Figure 2 A schematic diagram of a page refresh method according to an embodiment of the present invention;
[0052] Figure 3 is a schematic diagram of a page in an embodiment of the present invention;
[0053] Figure 4 A schematic diagram of determining an internal page corresponding to a target iframe tag in an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the structure of a page refresh device according to an embodiment of the present invention;
[0055] Figure 6 The figure is a schematic diagram of a hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the absence of conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0057] The term "comprising" and any variations thereof in the specification and claims of the present invention are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0058] In the embodiments of the present invention, one or more, "many" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or plural.
[0059] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, which includes various details of the embodiments of the present invention to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present invention, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present invention, but it does not mean that the applicant has or will necessarily use the solution.
[0060] In the technical solution of the present invention, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0061] At present, in the related art, a method of refreshing an internal page corresponding to an iframe tag is to refresh the internal page corresponding to the iframe tag together with refreshing the external page.
[0062] However, since the internal page corresponding to the iframe tag has been switched multiple times, the uniform resource location (URL) corresponding to the internal page may have changed, but the URL of the internal page is not synchronously updated to the src attribute of the iframe tag, resulting in the result of refreshing the internal page using the aforementioned refresh page not being the actual expected refreshed internal page, thereby reducing the user experience.
[0063] In view of this, an embodiment of the present invention provides a page refresh method, through which a click event for at least one iframe tag is monitored, and the information of at least one iframe tag is stored in a floating iframe tag list; the floating iframe tag list is used to store the iframe tags corresponding to the candidate internal pages to be refreshed; the target iframe tag is screened out from the floating iframe tag list; the target iframe tag is the iframe tag corresponding to the internal page that does not include a subpage in the floating iframe tag list. That is to say, in the embodiment of the present invention, since there is a one-to-one correspondence between the iframe tag and the internal page, the internal page to be refreshed can be accurately located by screening the target iframe tag, and the local reloading method can be executed inside the current page corresponding to the target iframe tag, thereby achieving the purpose of refreshing the internal page corresponding to the target iframe tag. In other words, the user can selectively refresh a certain internal page of the internal pages included in the current page, realize accurate refresh of the internal page, and improve the user experience.
[0064] After introducing the design concept of the embodiment of the present invention, the following briefly introduces the application scenarios to which the technical solution of the embodiment of the present invention can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiment of the present invention and are not limited. In the specific implementation process, the technical solution provided by the embodiment of the present invention can be flexibly applied according to actual needs.
[0065] The solution provided by the embodiment of the present invention can be applied to any business scenario of page refresh.
[0066] In an embodiment of the present invention, when a user needs to refresh an internal page corresponding to a certain iframe tag, the user can right-click and refresh the cursor on a platform set on the corresponding terminal device 101 to specify the internal page corresponding to the iframe tag to be refreshed, so that the terminal device 101 can obtain a click event for at least one iframe tag, and then the terminal device 101 can send a corresponding click event to the electronic device 102, so that the electronic device 102 can store the information of at least one iframe tag in a floating iframe tag list according to the click event; the floating iframe tag list is used to store the iframe tags corresponding to the candidate internal pages to be refreshed; the target iframe tag is filtered out from the floating iframe tag list; the target iframe tag is the iframe tag corresponding to the internal page that does not include a sub-page in the floating iframe tag list; inside the current page corresponding to the target iframe tag, a local reload method is executed to refresh the internal page corresponding to the target iframe tag.
[0067] In the embodiment of the present invention, the terminal device 101 may be, for example, a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart car device, a wearable device, etc., which is not limited in the embodiment of the present invention.
[0068] In an embodiment of the present invention, the electronic device 102 may be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. It may also be a physical server or a server cluster, but is not limited to these.
[0069] Among them, the terminal device 101, the electronic device 102, and each terminal device 101 can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, the wireless network can be a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, and of course it can be other possible networks, which are not limited in the embodiment of the present invention.
[0070] Of course, the method provided in the embodiment of the present invention is not limited to Figure 1 The application scenario shown can also be used in other possible application scenarios, such as only executing the page refresh method by a terminal device, which is not limited in the embodiment of the present invention. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.
[0071] To further illustrate the technical solution provided by the embodiment of the present invention, the following is a detailed description of this in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present invention provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present invention. The method may be executed in the order of the method shown in the embodiment or drawings or in parallel during the actual processing process or when the device is executed.
[0072] See also Figure 2 , Figure 2 : is a flow chart of a page refresh method in an embodiment of the present invention. The method flow can be executed by an electronic device, for example, the electronic device can be a terminal device or a server, and the specific implementation flow of the method is as follows:
[0073] Step 201: a click event for at least one iframe tag is monitored, and information of at least one iframe tag is stored in a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed.
[0074] In an embodiment of the present invention, the electronic device can call the JavaScript native method MutationObserver method to monitor the current page and determine whether the current page has changed. If it has changed, the iframe tags corresponding to all internal pages in the current page can be obtained, and an iframe tag list can be established based on the iframe tags corresponding to all internal pages; then the iframe tag list can be traversed, and a listening event for the click event can be established for each iframe tag respectively; the listening event is used to listen to whether a click event for at least one iframe tag is triggered.
[0075] Optionally, the click event is, for example, a mouseover event triggered when a user operates a mouse so that the cursor floats above the iframe tag and clicks it, or, for example, a click event is triggered when a user operates a stylus or finger, or any object that can trigger a click operation on the display screen, which is not limited to this in the embodiments of the present invention.
[0076] In an embodiment of the present invention, the electronic device determines the top-level page among all the internal pages included in the current page, and sets a new listening event for the top-level page to listen to the contextmenu event; when it is monitored that the contextmenu event is triggered, it is determined that the menu function is started, so that it can be determined whether there is an iframe tag in the floating iframe tag list. After it is determined that the iframe tag exists in the floating iframe tag list, it is determined that a click event for at least one iframe tag is listened to.
[0077] In an embodiment of the present invention, when the user operates the mouse to make the cursor float above the iframe tag, a mouseover event can be triggered, so that the electronic device can obtain information about the iframe tag that triggers the mouseover event and store the information in a floating iframe tag list.
[0078] For example, see Figure 3 , Figure 3 Schematic diagram of a page in an embodiment of the present invention. Figure 3 In the figure, the current page includes 4 internal pages, namely page A, page B, page C and page D, and page A nests page B and page C through the iframe tag, and page C nests page D through the iframe tag. When the user puts the mouse on page D, the mouseover event of the iframe tag where page D is located will be triggered, so that the information of page D can be passed to page C. Page C then passes the information of page D and page C to page A, and finally stores them in the floating iframe tag list corresponding to page A.
[0079] In an embodiment of the present invention, before storing information of at least one iframe tag into a floating iframe tag list, the electronic device may respectively determine the iframe tag object of each iframe tag to determine whether to store it in the floating iframe tag list based on the iframe tag object; optionally, the identification information in the iframe tag object may be matched with the identification information in the floating iframe tag list. If the match is unsuccessful, that is, the iframe tag object does not exist in the floating iframe tag list, the iframe tag corresponding to the iframe tag object is stored in the floating iframe tag list.
[0080] Optionally, the iframe tag object includes a parentList attribute for indicating identification information of the iframe tag and for storing identification information of at least one parent page of the internal page corresponding to the iframe tag. Figure 3 , the parent page of page D is page C, the parent page of page C is page A, and the parent page of page B is page A, then the parentList attribute of page D can be determined, and the parentList attribute includes the identification information of page C and the identification information of page A. It can also be determined that the length information of the parentList attribute is 2, the parentList attribute of page C includes the identification information of page A, the parentList attribute of page B includes the identification information of page A, and the length information of pages C and B is 1.
[0081] In an embodiment of the present invention, considering the possibility of misselection or no need to refresh an internal page, when the electronic device monitors a cancel event for an iframe tag, the iframe tag is deleted from the list of suspended iframe tags; wherein the cancel event is, for example, a mouseout event triggered when the user moves the mouse away from the top of the iframe tag. Or it is an event triggered by a user using a stylus or finger, or any other object that can trigger the click operation multiple times on the display screen within a preset event. Also, the subpage of the internal page corresponding to the iframe tag is determined, and the iframe tag corresponding to the subpage is determined, and the parentList attribute of the iframe tag of the subpage is adjusted to obtain an updated list of suspended iframe tags.
[0082] Step 202: Filter out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list.
[0083] In an embodiment of the present invention, the electronic device can determine the length information of the parentList attribute of each iframe tag in the floating iframe tag list; and use the iframe tag whose parentList attribute length information is smaller than a preset value as the target iframe tag.
[0084] For example, see Figure 4 , Figure 4 This is a schematic diagram of determining a target iframe tag in an embodiment of the present invention. When the user hovers the mouse over an iframe tag, there may be multiple iframe tags nested, which triggers multiple iframe tags and multiple mouseover events, so that multiple values are stored in the suspended iframe tag list. Please continue to refer to Figure 4 The current page includes three internal pages, namely page A, page B and page C. Among them, page A nests page B through the iframe tag, and page B nests page C through the iframe tag.
[0085] When the user hovers the mouse over page C, because page B contains page C, it is also hovered over page B, thus triggering the mouseover events corresponding to page B and page C at the same time. Therefore, the iframe tags of page B and page C are stored in the suspended iframe tag list, and then the length information of the parentList attribute of page B and page C can be compared with the preset value, so as to determine the bottom iframe tag, that is, the inner page excluding the child page (that is, Figure 4 C page in the ).
[0086] Step 203: Inside the current page corresponding to the target iframe tag, execute a local reload method to refresh the internal page corresponding to the target iframe tag.
[0087] In an embodiment of the present invention, an electronic device can execute a local reload (location.reload) method inside the current page corresponding to the target iframe tag to refresh the internal page corresponding to the target iframe tag. Specifically, a refresh message is sent to the internal page corresponding to the specified target iframe tag. After the internal page receives the refresh message, the location.reload method is executed on the internal page to refresh the internal page once, thereby achieving the problem of separate refresh. That is to say, in an embodiment of the present invention, the internal page that needs to be refreshed separately is accurately determined by screening the target iframe tag, thereby avoiding the situation where the internal page that actually needs to be refreshed separately is not refreshed. Moreover, since the cross-domain page and the parent page can send message messages, the parent page and its corresponding child page notify the internal page corresponding to the target iframe tag by sending a message message. Therefore, this method can also achieve separate refresh for the internal page corresponding to the cross-domain iframe tag, thereby improving the user experience.
[0088] Based on the same inventive concept, an embodiment of the present invention also provides a page refresh device. Figure 5 As shown, it is a schematic diagram of the structure of a page refresh device 500, which may include:
[0089] The processing unit 501 is used to monitor a click event for at least one iframe tag, and store information of the at least one iframe tag into a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed;
[0090] A screening unit 502 is configured to screen out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list;
[0091] The refreshing unit 503 is used to execute a local reloading method inside the current page corresponding to the target iframe tag to refresh the internal page corresponding to the target iframe tag.
[0092] In a possible implementation manner, the processing unit 501 is further configured to:
[0093] Obtain the iframe tags corresponding to all internal pages in the current page, and create an iframe tag list based on the iframe tags corresponding to all the internal pages;
[0094] The iframe tag list is traversed, and a monitoring event for the click event is established for each iframe tag respectively; the monitoring event is used to monitor whether the click event is triggered.
[0095] In a possible implementation manner, the processing unit 501 is further configured to:
[0096] Determine the iframe tag object of each of the at least one iframe tag respectively, and determine whether to store it in the floating iframe tag list based on the iframe tag object;
[0097] The iframe tag object includes identification information for indicating the iframe tag and a parentList attribute for storing identification information of at least one parent page of the internal page corresponding to the iframe tag.
[0098] In a possible implementation, the screening unit 502 is specifically configured to:
[0099] Determine the length information of the parentList attribute of each iframe tag in the floating iframe tag list;
[0100] The iframe tag whose parentList attribute length information is smaller than the preset value is used as the target iframe tag.
[0101] In a possible implementation manner, the device further includes an updating unit, configured to:
[0102] When a cancel event for an iframe tag is monitored, deleting the iframe tag from the suspended iframe tag list; and,
[0103] The subpage of the internal page corresponding to the iframe tag is determined, and the iframe tag corresponding to the subpage is determined, and the parentList attribute of the iframe tag of the subpage is adjusted to obtain an updated floating iframe tag list.
[0104] In a possible implementation manner, the processing unit 501 is specifically configured to:
[0105] Determine the top-level page among all the internal pages included in the current page, and set a new listening event for listening to the contextmenu event for the top-level page;
[0106] When it is monitored that the contextmenu event is triggered and it is determined that there is an iframe tag in the floating iframe tag list, it is determined that a click event for at least one iframe tag is monitored.
[0107] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present invention, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0108] After introducing the page refresh method and device according to the exemplary embodiment of the present invention, next, an electronic device according to another exemplary embodiment of the present invention is introduced.
[0109] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0110] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present invention. In this embodiment, the structure of the electronic device can be as follows Figure 6 As shown, the electronic device is, for example, the aforementioned Figure 1 The electronic device 102, such as Figure 6 As shown, the electronic device in the embodiment of the present invention includes at least one processor 601, and a memory 602 and a communication interface 603 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present invention. Figure 6 In the example, the processor 601 and the memory 602 are connected via the system bus 600. Figure 6 The connections between other components are shown in bold lines, and are not intended to be limiting. The system bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0111] In the embodiment of the present invention, the memory 602 stores instructions that can be executed by at least one processor 601 , and the at least one processor 601 can execute the steps included in the aforementioned page refresh method by executing the instructions stored in the memory 602 .
[0112] Among them, the processor 601 is the control center of the electronic device, and various interfaces and lines can be used to connect various parts of the entire electronic device. By running or executing instructions stored in the memory 602 and calling data stored in the memory 602, various functions of the electronic device can be realized. Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the processor 601 mainly processes the operating system, the customer interface and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0113] The processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0114] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present invention can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0115] The communication interface 603 is a transmission interface that can be used for communication, and data can be received or sent through the communication interface 603 .
[0116] In addition, the electronic device also includes a basic input / output system (I / O system) 604 for facilitating information transmission between various components within the electronic device, and a large-capacity storage device 608 for storing an operating system 605, application programs 606 and other program modules 607.
[0117] The basic input / output system 604 includes a display 609 for displaying information and an input device 610 such as a mouse and a keyboard for a client to input information. The display 609 and the input device 610 are connected to the processor 601 through the basic input / output system 604 connected to the system bus 600. The basic input / output system 604 may also include an input / output controller for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller also provides output to a display screen, a printer, or other types of output devices.
[0118] Specifically, the mass storage device 608 is connected to the processor 601 via a mass storage controller (not shown) connected to the system bus 600. The mass storage device 608 and its associated computer-readable medium provide non-volatile storage for the server package. That is, the mass storage device 608 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM drive.
[0119] According to various embodiments of the present invention, the electronic device can also be connected to a remote computer on the network through a network such as the Internet to run. That is, the electronic device can be connected to the network 611 through the communication interface 603 connected to the system bus 600, or in other words, the communication interface 603 can also be used to connect to other types of networks or remote computer systems (not shown).
[0120] An embodiment of the present invention further provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the technical solution of the page refresh method of the above embodiment.
[0121] An embodiment of the present invention further provides a computer program product, which includes: a computer program code, and when the computer program code runs on a computer, the computer can implement the technical solution of the page refresh method in the above embodiment when executing the computer program.
[0122] It can be understood by those skilled in the art that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions, the aforementioned program instructions belong to a computer program, the computer program can be stored in a computer-readable storage medium, and when the computer program is executed, the steps of the above method embodiments are executed; the readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0123] The program product of the embodiment of the present invention can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with a command execution system, device or device.
[0124] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0125] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0126] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the computing device, partially on the electronic device, as a separate software package, partially on the computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the computing device via any type 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., via the Internet using an Internet service provider).
[0127] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0128] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A page refresh method, It is characterized in that The method comprises: Listening to a click event for at least one iframe tag, storing information of the at least one iframe tag in a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed; Filtering out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list; Inside the current page corresponding to the target iframe tag, a local reloading method is executed to refresh the internal page corresponding to the target iframe tag.
2. The method according to claim 1, It is characterized in that Before monitoring a click event on at least one iframe tag, the method further includes: Obtain the iframe tags corresponding to all internal pages in the current page, and create an iframe tag list based on the iframe tags corresponding to all the internal pages; The iframe tag list is traversed, and a monitoring event for the click event is established for each iframe tag respectively; the monitoring event is used to monitor whether the click event is triggered.
3. The method according to claim 2, It is characterized in that Before storing the information of the at least one iframe tag into the floating iframe tag list, the method further includes: Determine the iframe tag object of each of the at least one iframe tag respectively, and determine whether to store it in the floating iframe tag list based on the iframe tag object; The iframe tag object includes identification information for indicating the iframe tag and a parentList attribute for storing identification information of at least one parent page of the internal page corresponding to the iframe tag.
4. The method according to claim 3, It is characterized in that From the floating iframe tag list, filter out target iframe tags, including: Determine the length information of the parentList attribute of each iframe tag in the floating iframe tag list; The iframe tag whose parentList attribute length information is smaller than the preset value is used as the target iframe tag.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: When a cancel event for an iframe tag is monitored, deleting the iframe tag from the suspended iframe tag list; and, The subpage of the internal page corresponding to the iframe tag is determined, and the iframe tag corresponding to the subpage is determined, and the parentList attribute of the iframe tag of the subpage is adjusted to obtain an updated floating iframe tag list.
6. The method according to any one of claims 1 to 4, It is characterized in that Listen for click events on at least one iframe tag, including: Determine the top-level page among all the internal pages included in the current page, and set a new listening event for listening to the contextmenu event for the top-level page; When it is monitored that the contextmenu event is triggered and it is determined that there is an iframe tag in the floating iframe tag list, it is determined that a click event for at least one iframe tag is monitored.
7. A page refresh device, It is characterized in that The device comprises: The processing unit is used to monitor a click event for at least one iframe tag, and store information of the at least one iframe tag into a floating iframe tag list; the floating iframe tag list is used to store iframe tags corresponding to candidate internal pages to be refreshed; A screening unit is used to screen out a target iframe tag from the floating iframe tag list; the target iframe tag is an iframe tag corresponding to an internal page that does not include a subpage in the floating iframe tag list; The refresh unit is used to execute a local reloading method inside the current page corresponding to the target iframe tag to refresh the internal page corresponding to the target iframe tag.
8. An electronic device, It is characterized in that The invention comprises 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, and the instructions are executed by the at least one processor to implement the method as claimed in any one of claims 1 to 6.
9. A computer storage medium, It is characterized in that The computer storage medium stores a computer program, and the computer program is used to enable a computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, It is characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Webpage refreshing method, webpage system and electronic equipment
CN110209966A
Page jumping method and device
CN115357330A
In-page navigation
EP4036761A1
