A browser page interception method, device, electronic device and storage medium
Through the message router device, the page routing switch mapping table, and the whitelist of the interception page script algorithm, the browser page access request is intercepted twice, which solves the problem of low browser page interception efficiency and improves the accuracy and efficiency of interception. .
Patent Information
- Application Number
- CN202311061732.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-08-22
AI Technical Summary
In the existing technology, browser page interception efficiency is low and inaccurate, and it is difficult to effectively improve the efficiency and accuracy of browser page interception.
Through the message router device, the page routing switch mapping table and the whitelist of the interception page script algorithm are used to intercept the access requests of multiple browser pages twice, determine the page to be intercepted, the target interception script and the message consumption method, and realize the browser Interception of page access requests.
It improves the efficiency and accuracy of browser page interception and ensures accurate interception and processing of page requests to be intercepted.
Smart Images

Figure CN117093777B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer processing technology, and in particular to a method, device, electronic device and storage medium for intercepting a browser page. Background Art
[0002] An integrated development environment (IDE) is an application used to provide a program development environment. It generally includes tools such as code editors, compilers, debuggers, and graphical user interfaces. It integrates an integrated development software service suite including code writing, analysis, compilation, and debugging functions. With the improvement of Internet technology and the storage capacity of computing devices, online integrated development environments (or Web IDEs) have emerged. An online integrated development environment is an integrated development environment for program developers based on cloud services. Usually, the interception of browser pages is done by embedding a browser (webview), following the method of the specific page, and developing operations corresponding to the interception method in the background of the plug-in. The diversification of the form and function of this operation will lead to technical problems such as low efficiency and inaccuracy in the interception process of the browser page. Therefore, how to improve the efficiency and accuracy of browser page interception has become a technical issue that cannot be underestimated. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide a browser page interception method, device, electronic device and storage medium, which uses a message router device to use a page routing switch mapping table and a white list of an interception page script algorithm to intercept access requests for multiple browser pages twice, thereby improving the efficiency and accuracy of browser page interception.
[0004] The present application provides a method for intercepting a browser page, the method comprising:
[0005] Based on the access requests of multiple browser pages and a preset page routing switch mapping table, determining the access requests of the browser pages to be intercepted among the access requests of the multiple browser pages;
[0006] Based on a preset whitelist of interception page script algorithms and the access request of the browser page to be intercepted, determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted;
[0007] A target identifier corresponding to the target interception script algorithm is determined, and a message consumption method corresponding to the target interception script algorithm is determined based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted.
[0008] In a possible implementation manner, for any of the browser page access requests, determining the browser page access request to be intercepted among the multiple browser page access requests based on the multiple browser page access requests and a preset page routing switch mapping table includes:
[0009] Detect whether the page name of the browser page is in the page routing switch mapping table;
[0010] If it exists, then detecting whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is turned on;
[0011] If it is closed, it is determined that the message router device does not intercept the access request to the browser page;
[0012] If it is turned on, it is determined that the access request of the browser page is an access request of the browser page to be intercepted.
[0013] In a possible implementation manner, for any of the access requests of the browser pages to be intercepted, the whitelist based on the preset interception page script algorithm and the access request of the browser pages to be intercepted, determining the target interception script algorithm corresponding to the access request of the browser pages to be intercepted, includes:
[0014] Obtaining at least one script algorithm corresponding to the access request of the browser page to be intercepted;
[0015] Detecting whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist in the white list of interception page script algorithms;
[0016] If both exist, it is determined that the script algorithm in the white list of interception page script algorithms is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
[0017] In a possible implementation manner, the target identifier corresponding to the target interception script algorithm is determined by the following steps:
[0018] Obtain a mapping table between preset script algorithms and identifiers;
[0019] Based on the mapping table between the script algorithm and the identifier and the target interception script algorithm, the target identifier corresponding to the target interception script algorithm is determined.
[0020] In a possible implementation manner, the message consumption method corresponding to the target interception script algorithm is determined based on the target identifier, including:
[0021] Determine a target message based on the target interception script algorithm, and add a target identifier to the target message; wherein one target message corresponds to one message channel;
[0022] Determining a corresponding message channel based on the identification information of the target message;
[0023] Based on the message channel and a mapping table between preset identifiers and consumption methods, a message consumption method corresponding to the target interception script algorithm is determined.
[0024] In a possible implementation manner, after determining the target identifier corresponding to the target interception script algorithm and determining the message consumption method corresponding to the target interception script algorithm based on the target identifier, the interception method further includes:
[0025] The message consumption result corresponding to the target interception script algorithm is returned to the response bus of the browser page, and the response bus of the browser page feeds back the message consumption result to the corresponding browser page for display.
[0026] In a possible implementation manner, the interception method further includes:
[0027] The page routing switch mapping table and the white list of interception page script algorithms are edited based on business requirements, and the edited page routing switch mapping table and the white list of interception page script algorithms are stored.
[0028] The embodiment of the present application also provides a browser page interception device, the interception device comprising:
[0029] A first determination module, configured to determine, based on the access requests of the multiple browser pages and a preset page routing switch mapping table, the access requests of the browser pages to be intercepted among the multiple access requests of the browser pages;
[0030] A second determination module is used to determine a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a preset white list of interception page script algorithms and the access request of the browser page to be intercepted;
[0031] The message consumption module is used to determine the target identifier corresponding to the target interception script algorithm, and determine the message consumption method corresponding to the target interception script algorithm based on the target identifier to complete the interception of the access request of the browser page to be intercepted.
[0032] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the browser page interception method as described above are performed.
[0033] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned browser page interception method are executed.
[0034] The embodiments of the present application provide a browser page interception method, device, electronic device and storage medium, which use a message router device to use a page routing switch mapping table and a white list of an interception page script algorithm to intercept access requests for multiple browser pages twice, thereby improving the efficiency and accuracy of browser page interception.
[0035] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 One of the flow charts of a method for intercepting a browser page provided in an embodiment of the present application;
[0038] Figure 2 A second flowchart of a method for intercepting a browser page provided in an embodiment of the present application;
[0039] Figure 3 One of the structural schematic diagrams of a browser page interception device provided in an embodiment of the present application;
[0040] Figure 4 A second structural diagram of a browser page interception device provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0043] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0044] In order to enable those skilled in the art to use the contents of this application, the following implementation method is given in combination with the specific application scenario of "intercepting browser pages". For those skilled in the art, the general principles defined here can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0045] The following methods, devices, electronic devices or computer-readable storage media of the embodiments of the present application can be applied to any scenario where browser pages need to be intercepted. The embodiments of the present application are not limited to specific application scenarios. Any solution using a browser page interception method, device, electronic device and storage medium provided by the embodiments of the present application is within the protection scope of the present application.
[0046] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of computer processing technology.
[0047] According to research, an integrated development environment (IDE) is an application used to provide a program development environment, generally including tools such as code editors, compilers, debuggers, and graphical user interfaces, integrating code writing functions, analysis functions, compilation functions, debugging functions, and other integrated development software service sets. With the improvement of Internet technology and the storage capacity of computing devices, online integrated development environments (or Web IDEs) have emerged. An online integrated development environment is an integrated development environment for program developers based on cloud services. Usually, the interception of browser pages is done by embedding a browser (webview), according to the method of the specific page, and developing operations corresponding to the interception method in the background of the plug-in. The form and function diversity of this operation will lead to technical problems such as low efficiency and inaccuracy in the interception process of the browser page. Therefore, how to improve the efficiency and accuracy of browser page interception has become a technical issue that cannot be underestimated.
[0048] Based on this, an embodiment of the present application provides a method for intercepting browser pages, which uses a message router device to use a page routing switch mapping table and a white list of an interception page script algorithm to intercept access requests for multiple browser pages twice, thereby improving the efficiency and accuracy of browser page interception.
[0049] See also Figure 1 , Figure 1 This is one of the flowcharts of a method for intercepting a browser page provided in an embodiment of the present application. Figure 1 As shown in , the interception method provided by the embodiment of the present application includes:
[0050] S101: Based on multiple browser page access requests and a preset page routing switch mapping table, determine a browser page access request to be intercepted among the multiple browser page access requests.
[0051] In this step, the access requests of the browser pages to be intercepted among the access requests of the multiple browser pages are determined according to the access requests of the multiple browser pages and a preset page routing switch mapping table.
[0052] Here, usually a project has many web browser pages. It is necessary to select the page names of certain web browser pages according to business functions and demand directions and fill them into the page routing switch mapping table, so as to determine the page name corresponding to the state of turning on the routing switch in the page routing switch mapping table, and then determine the access request of the browser page with the page name as the access request of the browser page to be intercepted.
[0053] Among them, the interception capability of these pages can be achieved through the embedded page browser of the IDE. The message router has a request bus and can obtain the page name.
[0054] Here, the message router device is a message router embedded in the page browser of the IDE plug-in, which can realize that a web page can be used for web server display and also for the IDE plug-in.
[0055] In a possible implementation manner, for any of the browser page access requests, determining the browser page access request to be intercepted among the multiple browser page access requests based on the multiple browser page access requests and a preset page routing switch mapping table includes:
[0056] A: Check whether the page name of the browser page is in the page routing switch mapping table.
[0057] Here, it is detected whether the page name of the browser page exists in the page routing switch mapping table.
[0058] B: If it exists, then detect whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is turned on.
[0059] Here, if it exists, continue to monitor whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is turned on.
[0060] C: If it is off, it is determined that the message router device does not intercept the access request to the browser page; if it is on, it is determined that the access request to the browser page is an access request to the browser page to be intercepted.
[0061] Here, if it is closed, it is determined that the message router device does not intercept the access request of the browser page. If it is opened, it is determined that the access request of the browser page is an access request of the browser page to be intercepted and the access request of the browser page needs to be intercepted.
[0062] Among them, after the switch of the message router device is turned on, the preset page routing switch mapping table defines which specific browser pages can enter the message router device. For example, if the routing switches of browser page 1, browser page 2 and browser page 3 are configured to be turned on in the page routing switch mapping table, it means that these three browser pages enter the message router device for interception. Conversely, browser pages not recorded in the page routing switch mapping table do not enter the message router device.
[0063] S102: Based on a preset white list of interception page script algorithms and the access request of the browser page to be intercepted, determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted.
[0064] In this step, a target interception script algorithm corresponding to the access request of the browser page to be intercepted is determined according to a preset white list of interception page script algorithms and the access request of the browser page to be intercepted.
[0065] Here, there are many web browsing pages under the project, and the browser page to be intercepted is selected. However, there are many script algorithms under a web browsing page, and this solution also provides the function of intercepting these script algorithms. First, after filtering out the access requests of the browser page to be intercepted, the information of the browser page to be intercepted and other requests of the script algorithm under the browser page to be intercepted can also be captured. However, since there are many script algorithms under a browser page and the range is too large, it is necessary to use the whitelist of the intercepted page script algorithm to narrow the range.
[0066] In a possible implementation manner, for any of the access requests of the browser pages to be intercepted, the whitelist based on the preset interception page script algorithm and the access request of the browser pages to be intercepted, determining the target interception script algorithm corresponding to the access request of the browser pages to be intercepted, includes:
[0067] (1): Obtain at least one script algorithm corresponding to the access request of the browser page to be intercepted.
[0068] The message router device obtains at least one script algorithm corresponding to the access request of the browser page to be intercepted.
[0069] (2): Check whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist in the white list of interception page script algorithms.
[0070] Here, it is detected whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist in the white list of intercepted page script algorithms.
[0071] (3): If both exist, it is determined that the script algorithm in the white list of interception page script algorithms is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
[0072] Here, if both exist, it is determined that the script algorithm in the white list of interception page script algorithms is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
[0073] Among them, by entering the access request of the browser page to be intercepted according to the filtering, all the script algorithms under the browser page to be intercepted can be obtained. According to the white list of the intercepted page script algorithm, matching is performed, and the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted are matched according to the two fields of the page name and the intercepted script algorithm in the white list of the intercepted page script algorithm. If the match is successful, the target interception script algorithm corresponding to the access request of the browser page to be intercepted is intercepted, thereby realizing the double interception of the access request of the browser page to be intercepted. Otherwise, no interception is performed.
[0074] S103: Determine a target identifier corresponding to the target interception script algorithm, and determine a message consumption method corresponding to the target interception script algorithm based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted.
[0075] In this step, a target identifier corresponding to the target interception script algorithm is determined, and a message consumption method corresponding to the target interception script algorithm is determined according to the target identifier, so as to complete the interception of the access request to the browser page to be intercepted.
[0076] In a possible implementation manner, the target identifier corresponding to the target interception script algorithm is determined by the following steps:
[0077] Obtain a mapping table between a preset script algorithm and an identifier; based on the mapping table between the script algorithm and the identifier and the target interception script algorithm, determine the target identifier corresponding to the target interception script algorithm.
[0078] Here, a mapping table between a preset script algorithm and an identifier is obtained, and a target identifier corresponding to the target interception script algorithm is determined according to the mapping table between the script algorithm and the identifier and the target interception script algorithm.
[0079] Among them, when the target interception script algorithm corresponding to the access request of the browser page to be intercepted is determined according to the white list of interception page script algorithms, the identification information corresponding to the script algorithm in which the interception is effective can be accurately reflected according to the mapping table between the script algorithm and the identification.
[0080] In a possible implementation manner, the message consumption method corresponding to the target interception script algorithm is determined based on the target identifier, including:
[0081] a: Determine a target message based on the target interception script algorithm, and add a target identifier to the target message; wherein one target message corresponds to one message channel.
[0082] Here, a target message is generated according to a target interception script algorithm, and a target identifier is added to the target message; wherein one target message corresponds to one message channel.
[0083] b: Determine the corresponding message channel based on the identification information of the target message.
[0084] Here, the corresponding message channel is determined according to the identification information of the target message, wherein the message channel of the target message may be determined according to a preset relationship, or a currently idle message channel may be determined as the message channel corresponding to the target message.
[0085] c: Based on the message channel and a mapping table between preset identifiers and consumption methods, determine the message consumption method corresponding to the target interception script algorithm.
[0086] Here, the message consumption method corresponding to the target interception script algorithm is determined according to the message channel and the mapping table between the preset identifier and the consumption method.
[0087] Among them, the message consumption method is the process of processing the target message (target interception script algorithm).
[0088] Among them, in the mapping table structure between script algorithms and identifiers, the first field is the identifier, and this identifier information is the serial number information in the whitelist of the intercepted page script algorithm, so that precise operation can be achieved, and the specific intercepted script algorithm and the identifier are one-to-one corresponding without confusion. Among them, the mapping table between the script algorithm and the identifier can be edited.
[0089] In a possible implementation manner, the interception method further includes:
[0090] The page routing switch mapping table and the white list of interception page script algorithms are edited based on business requirements, and the edited page routing switch mapping table and the white list of interception page script algorithms are stored.
[0091] Here, the page routing switch mapping table and the white list of intercepted page script algorithms are edited according to business requirements, and the edited page routing switch mapping table and the white list of intercepted page script algorithms are stored.
[0092] In a possible implementation manner, after determining the target identifier corresponding to the target interception script algorithm and determining the message consumption method corresponding to the target interception script algorithm based on the target identifier, the interception method further includes:
[0093] The message consumption result corresponding to the target interception script algorithm is returned to the response bus of the browser page, and the response bus of the browser page feeds back the message consumption result to the corresponding browser page for display.
[0094] Here, the message consumption result corresponding to the target interception script algorithm is returned to the response bus of the browser page, and the response bus of the browser page feeds back the message consumption result to the corresponding browser page for display, thereby completing a complete set of access request processes for the browser page to be intercepted.
[0095] Among them, in this scheme, the filtering page is opened through the message router device, and the specified script algorithm of the page is intercepted, and the corresponding identification is added to the script algorithm, and then the consumption channel where the subject is located is successfully entered, so as to carry out effective message consumption; and the consumption result is returned to the web page, thereby completing a complete set of access request processes for the browser page to be intercepted.
[0096] For further information, see Figure 2 , Figure 2 This is a second flow chart of a method for intercepting a browser page provided in an embodiment of the present application. Figure 2 As shown, S201: obtain the access request of the browser page according to the request bus and enter the message router device; S202: detect the mode of the routing switch of the browser page according to the page routing switch mapping table; S203: if the routing mode is on, determine the access request of the browser page to be intercepted among the access requests of the browser page; S204: match the script algorithm of the browser page to be intercepted according to the white list of the interception page script algorithm; S205: if the match is successful, determine the target interception script algorithm of the access request of the browser page to be intercepted; S206: the target interception script algorithm enters the message channel for consumption method consumption; S207: return the message consumption result to the browser page through the response bus. S208: if the match is unsuccessful, continue to execute the original script algorithm of the access request of the browser page to be intercepted.
[0097] A method for intercepting a browser page provided by an embodiment of the present application is applied to a message router device, and the interception method includes: based on access requests of multiple browser pages and a preset page routing switch mapping table, determining the access request of a browser page to be intercepted among the multiple access requests of the browser pages; based on a preset white list of interception page script algorithms and the access request of the browser page to be intercepted, determining the target interception script algorithm corresponding to the access request of the browser page to be intercepted; determining the target identifier corresponding to the target interception script algorithm, and determining the message consumption method corresponding to the target interception script algorithm based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted. The message router device uses the page routing switch mapping table and the white list of the interception page script algorithm to intercept the access requests of multiple browser pages twice, thereby improving the efficiency and accuracy of browser page interception.
[0098] See also Figure 3 , Figure 4 , Figure 3 One of the structural schematic diagrams of a browser page interception device provided in an embodiment of the present application; Figure 4 A second structural diagram of a browser page interception device provided in an embodiment of the present application. Figure 3 As shown in , the browser page interception device 300 includes:
[0099] A first determining module 310 is used to determine the access request of the browser page to be intercepted among the access requests of the multiple browser pages based on the access requests of the multiple browser pages and a preset page routing switch mapping table;
[0100] The second determination module 320 is used to determine the target interception script algorithm corresponding to the access request of the browser page to be intercepted based on the preset white list of interception page script algorithms and the access request of the browser page to be intercepted;
[0101] The message consumption module 330 is used to determine the target identifier corresponding to the target interception script algorithm, and determine the message consumption method corresponding to the target interception script algorithm based on the target identifier to complete the interception of the access request of the browser page to be intercepted.
[0102] Further, when the first determination module 310 is used to determine, for any of the browser page access requests, an access request for a browser page to be intercepted among the multiple browser page access requests based on the multiple browser page access requests and a preset page routing switch mapping table, the first determination module 310 is specifically used to:
[0103] Detect whether the page name of the browser page is in the page routing switch mapping table;
[0104] If it exists, then detecting whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is turned on;
[0105] If it is closed, it is determined that the message router device does not intercept the access request to the browser page;
[0106] If it is turned on, it is determined that the access request of the browser page is an access request of the browser page to be intercepted.
[0107] Further, when the second determination module 320 is used to determine the target interception script algorithm corresponding to the access request of the browser page to be intercepted for any access request of the browser page to be intercepted, the whitelist based on the preset interception page script algorithm and the access request of the browser page to be intercepted, the second determination module 320 is specifically used to:
[0108] Obtaining at least one script algorithm corresponding to the access request of the browser page to be intercepted;
[0109] Detecting whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist in the white list of interception page script algorithms;
[0110] If both exist, it is determined that the script algorithm in the white list of interception page script algorithms is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
[0111] Further, the message consumption module 330 determines the target identifier corresponding to the target interception script algorithm through the following steps:
[0112] Obtain a mapping table between preset script algorithms and identifiers;
[0113] Based on the mapping table between the script algorithm and the identifier and the target interception script algorithm, the target identifier corresponding to the target interception script algorithm is determined.
[0114] Further, when the message consumption module 330 is used to determine the message consumption method corresponding to the target interception script algorithm based on the target identifier, the message consumption module 330 is specifically used to:
[0115] Determine a target message based on the target interception script algorithm, and add a target identifier to the target message; wherein one target message corresponds to one message channel;
[0116] Determining a corresponding message channel based on the identification information of the target message;
[0117] Based on the message channel and a mapping table between preset identifiers and consumption methods, a message consumption method corresponding to the target interception script algorithm is determined.
[0118] Further, such as Figure 4 As shown, the interception device 300 further includes a feedback module 340, and the feedback module 340 is used to:
[0119] The message consumption result corresponding to the target interception script algorithm is returned to the response bus of the browser page, and the response bus of the browser page feeds back the message consumption result to the corresponding browser page for display.
[0120] Further, such as Figure 4 As shown, the interception device 300 further includes an editing module 350, and the editing module 350 is used to:
[0121] The page routing switch mapping table and the white list of interception page script algorithms are edited based on business requirements, and the edited page routing switch mapping table and the white list of interception page script algorithms are stored.
[0122] The embodiment of the present application provides a device for intercepting a browser page, the device comprising: a first determination module, for determining the access request of a browser page to be intercepted among the access requests of multiple browser pages based on the access requests of multiple browser pages and a preset page routing switch mapping table; a second determination module, for determining the target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a preset white list of interception page script algorithms and the access request of the browser page to be intercepted; a message consumption module, for determining the target identifier corresponding to the target interception script algorithm, and determining the message consumption method corresponding to the target interception script algorithm based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted. The message router device uses the page routing switch mapping table and the white list of the interception page script algorithm to intercept the access requests of multiple browser pages twice, thereby improving the efficiency and accuracy of browser page interception.
[0123] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0124] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 as well as Figure 2 The steps of the method for intercepting a browser page in the method embodiment shown, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0125] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The steps of the method for intercepting a browser page in the method embodiment shown, and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0126] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0127] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0130] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for intercepting a browser page, characterized in that: Applied to a message router device, the interception method comprises: Based on the access requests of multiple browser pages and a preset page routing switch mapping table, determining the access requests of the browser pages to be intercepted among the access requests of the multiple browser pages; Based on a preset whitelist of interception page script algorithms and the access request of the browser page to be intercepted, determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted; Determine a target identifier corresponding to the target interception script algorithm, and determine a message consumption method corresponding to the target interception script algorithm based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted; The method for determining the message consumption corresponding to the target interception script algorithm based on the target identifier includes: Determine a target message based on the target interception script algorithm, and add a target identifier to the target message; wherein one target message corresponds to one message channel; Determine the corresponding message channel based on the identification information of the target message; wherein the identification information is the serial number information in the whitelist of the interception page script algorithm; Based on the message channel and a mapping table between preset identifiers and consumption methods, a message consumption method corresponding to the target interception script algorithm is determined.
2. The interception method according to claim 1, characterized in that: For any of the browser page access requests, determining the browser page access request to be intercepted among the multiple browser page access requests based on the multiple browser page access requests and a preset page routing switch mapping table includes: Detect whether the page name of the browser page is in the page routing switch mapping table; If it exists, then detecting whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is turned on; If it is closed, it is determined that the message router device does not intercept the access request to the browser page; If it is turned on, it is determined that the access request of the browser page is an access request of the browser page to be intercepted.
3. The interception method according to claim 1, characterized in that: For any of the access requests of the browser pages to be intercepted, the whitelist based on the preset interception page script algorithm and the access request of the browser pages to be intercepted, determining the target interception script algorithm corresponding to the access request of the browser pages to be intercepted, includes: Obtaining at least one script algorithm corresponding to the access request of the browser page to be intercepted; Detecting whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist in the white list of interception page script algorithms; If both exist, it is determined that the script algorithm in the white list of interception page script algorithms is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
4. The interception method according to claim 1, characterized in that: The target identifier corresponding to the target interception script algorithm is determined by the following steps: Obtain a mapping table between preset script algorithms and identifiers; Based on the mapping table between the script algorithm and the identifier and the target interception script algorithm, the target identifier corresponding to the target interception script algorithm is determined.
5. The interception method according to claim 1, characterized in that: After determining the target identifier corresponding to the target interception script algorithm and determining the message consumption method corresponding to the target interception script algorithm based on the target identifier, the interception method further includes: The message consumption result corresponding to the target interception script algorithm is returned to the response bus of the browser page, and the response bus of the browser page feeds back the message consumption result to the corresponding browser page for display.
6. The interception method according to claim 1, characterized in that: The interception method also includes: The page routing switch mapping table and the white list of interception page script algorithms are edited based on business requirements, and the edited page routing switch mapping table and the white list of interception page script algorithms are stored.
7. A browser page interception device, characterized in that: The interception device comprises: A first determination module, configured to determine, based on the access requests of the multiple browser pages and a preset page routing switch mapping table, the access requests of the browser pages to be intercepted among the multiple access requests of the browser pages; A second determination module is used to determine a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a preset white list of interception page script algorithms and the access request of the browser page to be intercepted; A message consumption module, used to determine a target identifier corresponding to the target interception script algorithm, and determine a message consumption method corresponding to the target interception script algorithm based on the target identifier, so as to complete the interception of the access request of the browser page to be intercepted; When the message consumption module is used to determine the message consumption method corresponding to the target interception script algorithm based on the target identifier, the message consumption module is specifically used to: Determine a target message based on the target interception script algorithm, and add a target identifier to the target message; wherein one target message corresponds to one message channel; Determine the corresponding message channel based on the identification information of the target message; wherein the identification information is the serial number information in the whitelist of the interception page script algorithm; Based on the message channel and a mapping table between preset identifiers and consumption methods, a message consumption method corresponding to the target interception script algorithm is determined.
8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the browser page interception method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the browser page interception method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Method and device of website address access control
CN103259772A
Information interception method, device and terminal
CN110955855A
Webpage protection method, device and browser
CN112637185A
Dynamic script attack interception method and device, electronic equipment and readable storage medium
CN115065534A
System and Method for Blocking Internet Data Brokers and Networks
US20160330237A1
