CN117093777A - Method and device for intercepting browser page, electronic equipment and storage medium - Google Patents

Method and device for intercepting browser page, electronic equipment and storage medium Download PDF

Info

Publication number
CN117093777A
CN117093777A CN202311061732.7A CN202311061732A CN117093777A CN 117093777 A CN117093777 A CN 117093777A CN 202311061732 A CN202311061732 A CN 202311061732A CN 117093777 A CN117093777 A CN 117093777A
Authority
CN
China
Prior art keywords
page
interception
browser
target
intercepted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311061732.7A
Other languages
Chinese (zh)
Inventor
修宾彬
邵伏巧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lingyan Technology Co ltd
Original Assignee
Beijing Lingyan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lingyan Technology Co ltd filed Critical Beijing Lingyan Technology Co ltd
Priority to CN202311061732.7A priority Critical patent/CN117093777A/en
Publication of CN117093777A publication Critical patent/CN117093777A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0236Filtering by address, protocol, port number or service, e.g. IP-address or URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and a device for intercepting a browser page, electronic equipment and a storage medium, wherein the method comprises the following steps: determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table; determining a target interception script algorithm of the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted; and determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to intercept the access request of the browser page to be intercepted. The message router device intercepts the access requests of a plurality of browser pages twice by utilizing the page route switch mapping table and the white list of the interception page script algorithm, so that the efficiency and the accuracy of interception of the browser pages are improved.

Description

Method and device for intercepting browser page, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer processing technologies, and in particular, to a method and apparatus for intercepting a browser page, an electronic device, and a storage medium.
Background
An integrated development environment (IDE, integrated Development Environment) is an application program for providing a program development environment, and generally includes tools such as a code editor, a compiler, a debugger, and a graphical user interface, and integrates a code writing function, an analysis function, a compiling function, a debugging function, and the like. With the rise of internet technology and computing device power, online integrated development environments (or Web IDEs) have grown. The online integrated development environment is an integrated development environment for program developers based on cloud services. The interception of browser pages is usually implemented by embedding a browser (webview), according to the method of a specific page, and developing operations corresponding to the interception method in the background of the plug-in. The diversification of the operation form and function can cause the technical problems of low efficiency and inaccuracy of the interception process of the browser page, so how to improve the efficiency and accuracy of the interception of the browser page becomes a small technical problem.
Disclosure of Invention
Accordingly, the present application is directed to a method, an apparatus, an electronic device, and a storage medium for intercepting a browser page, which utilize a page routing switch mapping table and a white list of an interception page script algorithm to intercept access requests of a plurality of browser pages twice through a message router device, thereby improving efficiency and accuracy of intercepting the browser page.
The embodiment of the application provides a method for intercepting a browser page, which comprises the following steps:
determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table;
determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted;
and determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to intercept the access request of the browser page to be intercepted.
In one possible implementation manner, for any access request of the browser page, the determining, based on the access requests of the plurality of browser pages and a preset page routing switch mapping table, the access request of the browser page to be intercepted from among the access requests of the plurality of browser pages includes:
detecting whether the page name of the browser page exists in the page route switch mapping table;
if yes, detecting whether a routing switch corresponding to the page name of the browser page in the page routing switch mapping table is on or not;
if the browser page is closed, determining that the access request of the message router device to the browser page is not intercepted;
if the access request is the opening, determining that the access request of the browser page is the access request of the browser page to be intercepted.
In one possible implementation manner, for any access request of the to-be-intercepted browser page, the determining, based on a white list of a preset interception page script algorithm and the access request of the to-be-intercepted browser page, a target interception script algorithm corresponding to the access request of the to-be-intercepted browser page includes:
acquiring at least one script algorithm corresponding to the access request of the browser page to be intercepted;
detecting whether page names of the browser pages to be intercepted and any script algorithm of the browser pages to be intercepted exist in the white list of the script algorithm of the intercepted pages;
and if the target interception script algorithm exists in the white list of the interception page script algorithm, determining that the script algorithm existing in the white list of the interception page script algorithm is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
In one possible implementation manner, the target identifier corresponding to the target interception script algorithm is determined through the following steps:
obtaining a mapping table between a preset script algorithm and a mark;
and determining a target identifier corresponding to the target interception script algorithm based on a mapping table between the script algorithm and the identifier and the target interception script algorithm.
In one possible implementation manner, the message consumption method corresponding to the target interception script algorithm is determined based on the target identifier, and the method includes:
determining a target message based on the target interception script algorithm, and adding a target identifier on the target message; wherein one of the target messages corresponds to one message channel;
determining a corresponding message channel based on the identification information of the target message;
and determining a message consumption method corresponding to the target interception script algorithm based on the message channel and a mapping table between a preset identifier and the consumption method.
In one possible implementation manner, after the determining the target identifier corresponding to the target interception script algorithm, determining a message consumption method corresponding to the target interception script algorithm based on the target identifier, the interception method further includes:
and returning the message consumption result corresponding to the target interception script algorithm to a response bus of the browser page, and feeding the message consumption result back to the corresponding browser page by the response bus of the browser page for display.
In one possible embodiment, the intercepting method further includes:
and editing the page route switch mapping table and the white list of the interception page script algorithm based on service requirements, and storing the edited page route switch mapping table and the white list of the interception page script algorithm.
The embodiment of the application also provides an interception device of the browser page, which comprises:
the first determining module is used for determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table;
the second determining module is used for determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted;
and the message consumption module is used for determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to complete interception of the access request of the browser page to be intercepted.
The embodiment of the application also provides electronic equipment, which comprises: the system comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory are communicated through the bus when the electronic device runs, and the machine-readable instructions are executed by the processor to execute the steps of the browser page interception method.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to execute the steps of the browser page interception method.
According to the interception method, the interception device, the electronic equipment and the storage medium of the browser pages, provided by the embodiment of the application, the message router device is used for intercepting the access requests of a plurality of browser pages twice by utilizing the page routing switch mapping table and the white list of the interception page script algorithm, so that the efficiency and the accuracy of browser page interception are improved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is one of the flowcharts of a method for intercepting a browser page according to an embodiment of the present application;
FIG. 2 is a second flowchart of a method for intercepting a browser page according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an interception device for browser pages according to an embodiment of the present application;
FIG. 4 is a second schematic structural diagram of a device for intercepting a browser page according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be appreciated that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art based on embodiments of the application without making any inventive effort, fall within the scope of the application.
In order to enable those skilled in the art to make use of the present disclosure, the following embodiments are provided in connection with a specific application scenario "intercept browser pages", and it will be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of the present disclosure.
The method, the device, the electronic equipment or the computer readable storage medium can be applied to any scene needing to intercept the browser page, the embodiment of the application does not limit the specific application scene, and any scheme using the method, the device, the electronic equipment and the storage medium for intercepting the browser page provided by the embodiment of the application is within the protection scope of the application.
First, an application scenario to which the present application is applicable will be described. The application can be applied to the technical field of computer processing.
It has been found that an integrated development environment (IDE, integrated Development Environment) is an application program for providing a program development environment, and generally includes tools such as a code editor, a compiler, a debugger, and a graphical user interface, and integrates a code writing function, an analysis function, a compiling function, a debugging function, and the like. With the rise of internet technology and computing device power, online integrated development environments (or Web IDEs) have grown. The online integrated development environment is an integrated development environment for program developers based on cloud services. The interception of browser pages is usually implemented by embedding a browser (webview), according to the method of a specific page, and developing operations corresponding to the interception method in the background of the plug-in. The diversification of the operation form and function can cause the technical problems of low efficiency and inaccuracy of the interception process of the browser page, so how to improve the efficiency and accuracy of the interception of the browser page becomes a small technical problem.
Based on the above, the embodiment of the application provides a method for intercepting browser pages, which intercepts access requests of a plurality of browser pages twice by using a page route switch mapping table and a white list of an interception page script algorithm through a message router device, thereby improving the efficiency and accuracy of intercepting browser pages.
Referring to fig. 1, fig. 1 is a flowchart of a method for intercepting a browser page according to an embodiment of the present application. As shown in fig. 1, the interception method provided by the embodiment of the present application includes:
s101: and determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table.
In the step, according to the access requests of the plurality of browser pages and a preset page route switch mapping table, the access request of the browser page to be intercepted in the access requests of the plurality of browser pages is determined.
Here, in general, a set of engineering has a plurality of web browser pages, page names of some web browser pages need to be selected according to service functions and demand directions and filled into a page route switch mapping table, so that the page names corresponding to the states of opening route switches in the page route switch mapping table are determined, and then an access request of the browser pages with the page names is determined as an access request of the browser pages to be intercepted.
The interception capability of the pages can be realized through an embedded page browser of the IDE, and the message router is provided with a request bus and can acquire the page names.
Here, the message router device is a message router embedded in the page browser for the IDE plug-in, and can be implemented so that one web page can be used for web server presentation and also can be used in the IDE plug-in.
In one possible implementation manner, for any one of the access requests of the browser pages, the determining, based on the access requests of the plurality of browser pages and a preset page routing switch mapping table, the access request of the browser page to be intercepted from among the access requests of the plurality of browser pages includes:
a: and detecting whether the page name of the browser page exists in the page route switch mapping table.
Here, it is detected whether the page name of the browser page exists in the page route switch mapping table.
B: if yes, detecting whether a routing switch corresponding to the page name of the browser page in the page routing switch mapping table is on or not.
If so, continuing to monitor whether the routing switch corresponding to the page name of the browser page in the page routing switch mapping table is on.
C: if the browser page is closed, determining that the access request of the message router device to the browser page is not intercepted; if the access request is the opening, determining that the access request of the browser page is the access request of the browser page to be intercepted.
Here, if the request is closed, it is determined that the access request of the message router device to the browser page is not intercepted, and if the request 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.
After the switch of the message router device is turned on, defining which browser pages can enter the message router device according to a preset page route switch mapping table, for example, when the page route switch mapping table configures the route switches of the browser page 1, the browser page 2 and the browser page 3 to be turned on, the three browser pages enter the message router device for interception. In contrast, a browser page not described in the page routing switch mapping table does not enter the message router device.
S102: and determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted.
In the 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 the interception page script algorithm and the access request of the browser page to be intercepted.
Here, there are many web browsing pages under engineering, which are selected after the browser page is to be intercepted. There are many script algorithms under a web page, and the present solution also provides the function of intercepting these script algorithms. After the access request of the browser page to be intercepted is screened out, the information of the browser page to be intercepted and other requests of the script algorithm under the browser page to be intercepted can be completely captured. However, since many of the script algorithms under a browser page are too extensive, the white list that uses the interception page script algorithm is required to narrow.
In one possible implementation manner, for any access request of the to-be-intercepted browser page, the determining, based on a white list of a preset interception page script algorithm and the access request of the to-be-intercepted browser page, a target interception script algorithm corresponding to the access request of the to-be-intercepted browser page includes:
(1): and acquiring at least one script algorithm corresponding to the access request of the browser page to be intercepted.
The message router device acquires at least one script algorithm corresponding to the access request of the browser page to be intercepted.
(2): and detecting whether page names of the browser pages to be intercepted and any script algorithm of the browser pages to be intercepted exist in the white list of the page script interception algorithm.
Here, whether the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted exist or not is detected in the white list of the script algorithm of the intercepted page.
(3): and if the target interception script algorithm exists in the white list of the interception page script algorithm, determining that the script algorithm existing in the white list of the interception page script algorithm is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
If the target interception script algorithm exists in the white list of the interception page script algorithm, determining that the script algorithm existing in the white list of the interception page script algorithm is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
And entering an access request according to the filtered browser page to be intercepted, so that all script algorithms under the browser page to be intercepted can be obtained. Matching is carried out according to the white list of the interception page script algorithm, and matching is carried out according to the page name in the white list of the interception page script algorithm and two fields of the interception script algorithm, the page name of the browser page to be intercepted and any script algorithm of the browser page to be intercepted. If the matching is successful, intercepting a target interception script algorithm corresponding to the access request of the browser page to be intercepted, thereby realizing the twice interception of the access request of the browser page to be intercepted. Otherwise, the device is not intercepted.
S103: and determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to intercept the access request of the browser page to be intercepted.
In the step, a target identification corresponding to a target interception script algorithm is determined, and a message consumption method corresponding to the target interception script algorithm is determined according to the target identification, so that interception of access requests of the browser pages to be intercepted is completed.
In one possible implementation manner, the target identifier corresponding to the target interception script algorithm is determined through the following steps:
obtaining a mapping table between a preset script algorithm and a mark; and determining a target identifier corresponding to the target interception script algorithm based on a mapping table between the script algorithm and the identifier and the target interception script algorithm.
Here, a mapping table between a preset script algorithm and a mark is obtained, and a target mark corresponding to the target interception script algorithm is determined according to the mapping table between the script algorithm and the mark and the target interception script algorithm.
When a target interception script algorithm corresponding to an access request of a browser page to be intercepted is determined according to a white list of the interception page script algorithm, identification information corresponding to the script algorithm with effective interception can be accurately reflected according to a mapping table between the script algorithm and the identification.
In one possible implementation manner, the message consumption method corresponding to the target interception script algorithm is determined based on the target identifier, and the method includes:
a: determining a target message based on the target interception script algorithm, and adding a target identifier on the target message; wherein one of the target messages corresponds to one message channel.
Generating a target message according to a target interception script algorithm, and adding a target identifier on the target message; wherein a target message corresponds to a message channel.
b: and determining a corresponding message channel based on the identification information of the target message.
Here, the corresponding message channel is determined according to the identification information of the target message, where the message channel of the target message may be determined according to a preset relationship, or the currently idle message channel may be determined as the message channel corresponding to the target message.
c: and determining a message consumption method corresponding to the target interception script algorithm based on the message channel and a mapping table between a preset identifier and the consumption method.
Here, according to the message channel and the mapping table between the preset identifier and the consumption method, determining the message consumption method corresponding to the target interception script algorithm.
The message consumption method is a process for processing a target message (target interception script algorithm).
In the mapping table structure between the script algorithm and the identifier, the first field is the identifier, and the identifier information is sequence number information in a white list of the interception page script algorithm, so that accurate operation can be realized, the one-to-one correspondence between the script algorithm and the identifier of specific interception is realized, and confusion is avoided. Wherein the operation of editing the form can be performed on the implementation of the mapping table between the script algorithm and the identifier.
In one possible embodiment, the intercepting method further includes:
and editing the page route switch mapping table and the white list of the interception page script algorithm based on service requirements, and storing the edited page route switch mapping table and the white list of the interception page script algorithm.
And editing the page route switch mapping table and the white list of the interception page script algorithm according to the service requirement, and storing the edited page route switch mapping table and the white list of the interception page script algorithm.
In one possible implementation manner, after the determining the target identifier corresponding to the target interception script algorithm, determining a message consumption method corresponding to the target interception script algorithm based on the target identifier, the interception method further includes:
and returning the message consumption result corresponding to the target interception script algorithm to a response bus of the browser page, and feeding the message consumption result back to the corresponding browser page by the response bus of the browser page for display.
The message consumption results corresponding to the target interception script algorithm are returned to the response buses of the browser pages, and the response buses of the browser pages feed the message consumption results back to the corresponding browser pages for display, so that a complete set of flow of access requests of the browser pages to be intercepted is completed.
In the scheme, a filtering page is opened through a message router device, a specified script algorithm of the page is intercepted, a corresponding mark is added on the script algorithm, and a consumption channel where a theme is located is smoothly entered, so that effective message consumption is carried out; and returning the consumption result to the web page so as to complete a complete set of flow of the access request of the browser page to be intercepted.
Further, referring to fig. 2, fig. 2 is a second flowchart of a method for intercepting a browser page according to an embodiment of the present application. As shown in fig. 2, S201: acquiring an access request of a browser page according to a request bus, and entering a message router device; s202: detecting a mode of a route switch of a browser page according to a page route switch mapping table; s203: if the routing mode is started, determining an access request of the browser page to be intercepted from the access requests of the browser page; s204: matching the white list of the interception page script algorithm with the script algorithm of the browser page to be intercepted; s205: if the matching is successful, determining a target interception script algorithm of the access request of the browser page to be intercepted; s206: the target interception script algorithm enters a message channel to consume by a consumption method; s207: and returning the message consumption result to the browser page through the response bus. S208: if the matching is unsuccessful, continuing to execute the original script algorithm of the access request of the browser page to be intercepted.
The interception method of the browser page provided by the embodiment of the application is applied to a message router device, and comprises the following steps: determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table; determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted; and determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to intercept the access request of the browser page to be intercepted. The message router device intercepts the access requests of a plurality of browser pages twice by utilizing the page route switch mapping table and the white list of the interception page script algorithm, so that the efficiency and the accuracy of interception of the browser pages are improved.
Referring to fig. 3 and fig. 4, fig. 3 is a schematic structural diagram of an interception device for browser pages according to an embodiment of the present application; fig. 4 is a schematic structural diagram of a device for intercepting a browser page according to an embodiment of the present application. As shown in fig. 3, the interception device 300 of the browser page includes:
a first determining module 310, configured to determine an access request of a browser page to be intercepted from among access requests of a plurality of browser pages based on the access requests of the plurality of browser pages and a preset page routing switch mapping table;
the second determining module 320 is configured to determine a target interception script algorithm corresponding to the access request of the browser page to be intercepted, based on a preset whitelist of interception page script algorithms and the access request of the browser page to be intercepted;
and the message consumption module 330 is configured 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 interception of the access request of the browser page to be intercepted.
Further, when the first determining module 310 is configured to determine, for an access request of any one of the browser pages, an access request of a browser page to be intercepted among the access requests of the plurality of browser pages based on the access requests of the plurality of browser pages and a preset page routing switch mapping table, the first determining module 310 is specifically configured to:
detecting whether the page name of the browser page exists in the page route switch mapping table;
if yes, detecting whether a routing switch corresponding to the page name of the browser page in the page routing switch mapping table is on or not;
if the browser page is closed, determining that the access request of the message router device to the browser page is not intercepted;
if the access request is the opening, determining that the access request of the browser page is the access request of the browser page to be intercepted.
Further, when the second determining module 320 is configured to determine, for any access request of the to-be-intercepted browser page, a target interception script algorithm corresponding to the access request of the to-be-intercepted browser page based on the whitelist of the preset interception page script algorithm and the access request of the to-be-intercepted browser page, the second determining module 320 is specifically configured to:
acquiring at least one script algorithm corresponding to the access request of the browser page to be intercepted;
detecting whether page names of the browser pages to be intercepted and any script algorithm of the browser pages to be intercepted exist in the white list of the script algorithm of the intercepted pages;
and if the target interception script algorithm exists in the white list of the interception page script algorithm, determining that the script algorithm existing in the white list of the interception page script algorithm is the target interception script algorithm corresponding to the access request of the browser page to be intercepted.
Further, the message consumption module 330 determines the target identifier corresponding to the target interception script algorithm by:
obtaining a mapping table between a preset script algorithm and a mark;
and determining a target identifier corresponding to the target interception script algorithm based on a mapping table between the script algorithm and the identifier and the target interception script algorithm.
Further, when the message consumption module 330 is configured to determine, based on the target identifier, a message consumption method corresponding to the target interception script algorithm, the message consumption module 330 is specifically configured to:
determining a target message based on the target interception script algorithm, and adding a target identifier on the target message; wherein one of the target messages corresponds to one message channel;
determining a corresponding message channel based on the identification information of the target message;
and determining a message consumption method corresponding to the target interception script algorithm based on the message channel and a mapping table between a preset identifier and the consumption method.
Further, as shown in fig. 4, the interception device 300 further includes a feedback module 340, where the feedback module 340 is configured to:
and returning the message consumption result corresponding to the target interception script algorithm to a response bus of the browser page, and feeding the message consumption result back to the corresponding browser page by the response bus of the browser page for display.
Further, as shown in fig. 4, the interception device 300 further includes an editing module 350, where the editing module 350 is configured to:
and editing the page route switch mapping table and the white list of the interception page script algorithm based on service requirements, and storing the edited page route switch mapping table and the white list of the interception page script algorithm.
The embodiment of the application provides an interception device for a browser page, which comprises the following components: the first determining module is used for determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table; the second determining module is used for determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted; and the message consumption module is used for determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to complete interception of the access request of the browser page to be intercepted. The message router device intercepts the access requests of a plurality of browser pages twice by utilizing the page route switch mapping table and the white list of the interception page script algorithm, so that the efficiency and the accuracy of interception of the browser pages are improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 5, the electronic device 500 includes a processor 510, a memory 520, and a bus 530.
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 through the bus 530, and when the machine-readable instructions are executed by the processor 510, the steps of the method for intercepting a browser page in the method embodiments shown in fig. 1 and fig. 2 can be executed, and detailed implementation manners can refer to the method embodiments and are not repeated herein.
The embodiment of the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the method for intercepting a browser page in the method embodiments shown in fig. 1 and fig. 2 may be executed, and a specific implementation manner may refer to the method embodiment and will not be described herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the scope of the present application, but it should be understood by those skilled in the art that the present application is not limited thereto, and that the present application is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. An interception method of a browser page, which is applied to a message router device, the interception method comprising:
determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table;
determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted;
and determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to intercept the access request of the browser page to be intercepted.
2. The interception method according to claim 1, wherein for any one of the access requests of the browser pages, the determining, based on the access requests of the plurality of browser pages and a preset page routing switch mapping table, the access request of the browser page to be intercepted from among the access requests of the plurality of browser pages includes:
detecting whether the page name of the browser page exists in the page route switch mapping table;
if yes, detecting whether a routing switch corresponding to the page name of the browser page in the page routing switch mapping table is on or not;
if the browser page is closed, determining that the access request of the message router device to the browser page is not intercepted;
if the access request is the opening, determining that the access request of the browser page is the access request of the browser page to be intercepted.
3. The interception method according to claim 1, wherein, for any access request of the to-be-intercepted browser page, the determining, based on a whitelist of a preset interception page script algorithm and the access request of the to-be-intercepted browser page, a target interception script algorithm corresponding to the access request of the to-be-intercepted browser page includes:
acquiring at least one script algorithm corresponding to the access request of the browser page to be intercepted;
detecting whether page names of the browser pages to be intercepted and any script algorithm of the browser pages to be intercepted exist in the white list of the script algorithm of the intercepted pages;
and if the target interception script algorithm exists in the white list of the interception page script algorithm, determining that the script algorithm existing in the white list of the interception page script algorithm 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, wherein the target identifier corresponding to the target interception script algorithm is determined by:
obtaining a mapping table between a preset script algorithm and a mark;
and determining a target identifier corresponding to the target interception script algorithm based on a mapping table between the script algorithm and the identifier and the target interception script algorithm.
5. The interception method according to claim 1, wherein said determining, based on said target identifier, a message consumption method corresponding to said target interception script algorithm comprises:
determining a target message based on the target interception script algorithm, and adding a target identifier on the target message; wherein one of the target messages corresponds to one message channel;
determining a corresponding message channel based on the identification information of the target message;
and determining a message consumption method corresponding to the target interception script algorithm based on the message channel and a mapping table between a preset identifier and the consumption method.
6. The interception method according to claim 1, wherein after said determining a target identifier corresponding to said target interception script algorithm, determining a message consumption method corresponding to said target interception script algorithm based on said target identifier, said interception method further comprises:
and returning the message consumption result corresponding to the target interception script algorithm to a response bus of the browser page, and feeding the message consumption result back to the corresponding browser page by the response bus of the browser page for display.
7. The interception method according to claim 1, characterized in that said interception method further comprises:
and editing the page route switch mapping table and the white list of the interception page script algorithm based on service requirements, and storing the edited page route switch mapping table and the white list of the interception page script algorithm.
8. An interception device for a browser page, wherein the interception device comprises:
the first determining module is used for determining access requests of the browser pages to be intercepted from among the access requests of the browser pages based on the access requests of the browser pages and a preset page route switch mapping table;
the second determining module is used for determining a target interception script algorithm corresponding to the access request of the browser page to be intercepted based on a white list of the preset interception page script algorithm and the access request of the browser page to be intercepted;
and the message consumption module is used for determining a target identifier corresponding to the target interception script algorithm, and determining a message consumption method corresponding to the target interception script algorithm based on the target identifier so as to complete interception of the access request of the browser page to be intercepted.
9. An electronic device, comprising: a processor, a memory and a bus, said memory storing machine readable instructions executable by said processor, said processor and said memory communicating via said bus when the electronic device is running, said machine readable instructions when executed by said processor performing the steps of the method of intercepting a browser page according to any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of intercepting a browser page according to any of claims 1 to 7.
CN202311061732.7A 2023-08-22 2023-08-22 Method and device for intercepting browser page, electronic equipment and storage medium Pending CN117093777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311061732.7A CN117093777A (en) 2023-08-22 2023-08-22 Method and device for intercepting browser page, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311061732.7A CN117093777A (en) 2023-08-22 2023-08-22 Method and device for intercepting browser page, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117093777A true CN117093777A (en) 2023-11-21

Family

ID=88769389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311061732.7A Pending CN117093777A (en) 2023-08-22 2023-08-22 Method and device for intercepting browser page, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117093777A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259772A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and device of website address access control
US20160330237A1 (en) * 2015-05-08 2016-11-10 RedMorph, LLC System and Method for Blocking Internet Data Brokers and Networks
US9948649B1 (en) * 2014-12-30 2018-04-17 Juniper Networks, Inc. Internet address filtering based on a local database
CN110955855A (en) * 2018-09-27 2020-04-03 华为终端有限公司 Information interception method, device and terminal
CN112637185A (en) * 2020-12-18 2021-04-09 北京小米移动软件有限公司 Webpage protection method and device and browser

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259772A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and device of website address access control
US9948649B1 (en) * 2014-12-30 2018-04-17 Juniper Networks, Inc. Internet address filtering based on a local database
US20160330237A1 (en) * 2015-05-08 2016-11-10 RedMorph, LLC System and Method for Blocking Internet Data Brokers and Networks
CN110955855A (en) * 2018-09-27 2020-04-03 华为终端有限公司 Information interception method, device and terminal
CN112637185A (en) * 2020-12-18 2021-04-09 北京小米移动软件有限公司 Webpage protection method and device and browser

Similar Documents

Publication Publication Date Title
WO2018000607A1 (en) Method and electronic apparatus for identifying test case failure causes
CN102402479B (en) For the intermediate representation structure of static analysis
WO2015131804A1 (en) Call stack relationship acquiring method and apparatus
CN107783766B (en) Method and device for cleaning files of application program
CN107203535B (en) Information query method and device
CN110795353B (en) Quick application debugging method, device, equipment and storage medium
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
CN110727429A (en) Front-end page generation method, device and equipment
US20180196669A1 (en) Reduced save and restore instructions for call-clobbered registers
CN108595178B (en) Hook-based data acquisition method, device and equipment
CN111488286B (en) Method and device for independently developing Android modules
CN112486492A (en) Page generation method and device, storage medium and electronic equipment
CN110874216A (en) Complete code generation method, device, equipment and storage medium
CN111158667B (en) Code injection method and device, electronic equipment and storage medium
CN113703753B (en) Method and device for product development and product development system
CN105550250A (en) Access log processing method and apparatus
CN117093777A (en) Method and device for intercepting browser page, electronic equipment and storage medium
CN111414168A (en) Web application development method and device based on mind map and electronic equipment
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN113051178A (en) Test data construction method, device, equipment and medium
CN103326892A (en) Web interface operation method and device
CN113656041A (en) Data processing method, device, equipment and storage medium
CN109509467B (en) Code generation method and device
CN111858158A (en) Data processing method and device and electronic equipment
US10671397B2 (en) Reduced save and restore instructions for call-clobbered registers

Legal Events

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