CN110188296B - Application program embedded page processing method, browser, equipment and storage medium - Google Patents

Application program embedded page processing method, browser, equipment and storage medium Download PDF

Info

Publication number
CN110188296B
CN110188296B CN201910395368.5A CN201910395368A CN110188296B CN 110188296 B CN110188296 B CN 110188296B CN 201910395368 A CN201910395368 A CN 201910395368A CN 110188296 B CN110188296 B CN 110188296B
Authority
CN
China
Prior art keywords
browser
execution logic
type
embedded page
parameter
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.)
Active
Application number
CN201910395368.5A
Other languages
Chinese (zh)
Other versions
CN110188296A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910395368.5A priority Critical patent/CN110188296B/en
Publication of CN110188296A publication Critical patent/CN110188296A/en
Application granted granted Critical
Publication of CN110188296B publication Critical patent/CN110188296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The invention discloses a processing method of an embedded page of an application program and related equipment thereof. The method is applied to a browser, the browser is provided with a container simulation plug-in, and the method comprises the following steps: when the embedded page is opened, the container simulation plug-in injects a script code into the embedded page, wherein the script code is used for simulating an interface and an execution logic of a Window container; when the interface in the embedded page calling script code is determined, the browser obtains the parameters transmitted when the embedded page calls the interface, determines the corresponding execution logic from the script code according to the types of the parameters, and performs corresponding operation on the browser according to the execution logic. The method realizes the direct interaction of the embedded page of the application program and the browser by installing the simulation plug-in on the browser to simulate all interfaces and execution logics of the window, and the embedded page code can normally run on the browser and can also normally run in the window container, so that the development efficiency of the embedded page code is greatly improved.

Description

Application program embedded page processing method, browser, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for processing an embedded page of an application, a browser, a computer device, and a storage medium.
Background
At present, the floor form of the product is Window application, and HTML5 embedded in the Window application enables the Window application to equivalently provide a container, and all interaction, styles and requests are completed through HTML 5. There are many interfaces between windows containers and HTML5, for example, the following categories are dominant: 1) the container passes data to HTML 5; 2) HTML5 controls the rendering of the container's window; 3) HTML5 controls the interactive behavior of the container, which enables HTML5 to run properly on the browser through the Window container. It can be seen that there is a degree of coupling between HTML5 and the Window container, and HTML5 is not able to function properly on the browser when it is detached from the Window container. Therefore, how to enable HTML5 to run directly on a browser without using a Window container has become an urgent problem to be solved.
Disclosure of Invention
The present invention has been made to solve at least one of the technical problems of the related art to some extent.
Therefore, the first purpose of the present invention is to provide a processing method for an application embedded page, which can realize direct interaction between the application embedded page and a browser by installing a simulation plug-in on the browser to simulate all interfaces and execution logic of a window.
A second object of the present invention is to provide a browser.
A third object of the invention is to propose a computer device.
A fourth object of the invention is to propose a computer-readable storage medium.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a method for processing an application embedded page, where the method is applied to a browser, and the browser is installed with a container simulation plug-in, where the method includes: when the embedded page of the application program is opened, the container simulation plug-in injects a script code into the embedded page, wherein the script code is used for simulating an interface and an execution logic of a Window container; when the embedded page is determined to call the interface in the script code, the browser acquires parameters transmitted when the embedded page calls the interface; and the browser determines a corresponding execution logic from the script code according to the type of the parameter, and performs corresponding operation on the browser according to the execution logic.
According to the processing method of the application program embedded page, when the application program embedded page is opened, the container simulation plug-in injects the script code into the embedded page, wherein the script code is used for simulating the interface and the execution logic of a Window container, then when the embedded page calls the interface in the script code, the browser obtains the parameters transmitted when the embedded page calls the interface, then the browser determines the corresponding execution logic from the script code according to the types of the parameters, and corresponding operation is carried out on the browser according to the execution logic. The method realizes the direct interaction of the embedded page and the browser by installing the simulation plug-in on the browser to simulate all interfaces and execution logic of the window, and the embedded page code can normally run on the browser and can also normally run in the window container, so that the development efficiency of the embedded page code is greatly improved.
In order to achieve the above object, an embodiment of a second aspect of the present invention provides a browser, including: the system comprises a container simulation plug-in, a script code and a Window, wherein the container simulation plug-in is used for injecting the script code into an embedded page when the embedded page of an application program is opened, and the script code is used for simulating an interface and an execution logic of a Window container; the parameter acquisition module is used for acquiring parameters transmitted when the embedded page calls the interface when determining that the embedded page calls the interface in the script code; the processing module is used for acquiring parameters transmitted when the embedded page calls the interface is determined;
according to the browser provided by the embodiment of the invention, when the embedded 5 pages of the application program are opened, the container simulation plug-in injects script codes into the embedded pages, wherein the script codes are used for simulating the interface and the execution logic of a Window container, then when the embedded pages call the interface in the script codes, the browser obtains the parameters transmitted when the embedded pages call the interface, and then the browser determines the corresponding execution logic from the script codes according to the types of the parameters and performs corresponding operation on the browser according to the execution logic. Therefore, the embedded page and the browser are directly interacted by installing the simulation plug-in on the browser to simulate all interfaces and execution logic of the window, and the embedded page code can normally run on the browser and can also normally run in the window container, so that the development efficiency of the embedded page code is greatly improved.
To achieve the above object, a computer device according to a third embodiment of the present invention includes: the embedded page processing method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the embedded page processing method of the application program is realized.
To achieve the above object, a computer-readable storage medium according to a fourth embodiment of the present invention is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the method for processing an application-embedded page according to the first embodiment of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of an application inline page processing method according to one embodiment of the present invention.
Fig. 2 is a diagram illustrating an example of a prior art process for HTML5 pages.
FIG. 3 is an exemplary diagram of processing an HTML5 page, according to an embodiment of the present invention.
Fig. 4 is a flowchart of a method for processing an application inline page according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a browser according to an embodiment of the present invention.
FIG. 6 is a schematic diagram of a computer device according to one embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a page processing method, a browser, and a computer-readable storage medium of the application inline HTML5 according to an embodiment of the present invention with reference to the drawings.
Fig. 1 is a flowchart of an application inline page processing method according to one embodiment of the present invention. It should be noted that the method for processing the application embedded page according to the embodiment of the present invention may be applied to a browser according to the embodiment of the present invention, and the browser may be configured on a computer device. It should be noted that the browser of the embodiment of the present invention is installed with a container simulation plug-in, which can simulate all interfaces and execution logic of the Window container.
As shown in fig. 1, the method for processing the application embedded page may include:
s110, when the embedded page of the application program is opened, the container simulation plug-in injects script codes into the embedded page, wherein the script codes are used for simulating an interface and execution logic of a Window container.
It should be noted that, in the embodiment of the present invention, the application embedded page may be a page embedded in an application, for example, a detailed introduction page embedded in an application. The application embedded page is not limited to a web page developed by the HTML5 language, but may be other types of pages.
Alternatively, the container simulation plug-in may inject scripting code into the embedded page based on the Content Scripts of the browser plug-in when the application embedded page is opened.
That is, in the embodiment of the present invention, a container simulation plug-in may be developed in advance, and after the container simulation plug-in is installed on a browser, when it is detected that an embedded page of an application program is opened, the container simulation plug-in may automatically inject a Script code into the embedded page, where the Script code may be used to simulate an interface and execution logic of a Window container.
S120, when the interface in the embedded page calling script code is determined, the browser obtains the parameters transmitted when the embedded page calls the interface.
That is, when determining that the embedded page calls the interface in the script code, the browser may obtain the parameters passed when the embedded page calls the interface. In the embodiment of the present invention, the parameters include, but are not limited to, a parameter carrying a new window to be opened, a parameter carrying an HTTP request, a parameter carrying other plug-ins or interfaces to be invoked, and the like.
For example, when a user clicks on a "large activity introduction page" (where the page is an HTML5 page), the container simulation plug-in may first inject script code into the HTML5 page, so that the script code simulates the interface and execution logic of a Window container; when determining that the HTML5 page calls the interface "activity search. do" in the script code, the browser may obtain a parameter passed when the HTML5 page calls the interface, for example, the parameter may be a parameter carrying a new window to be opened.
S130, the browser determines a corresponding execution logic from the script code according to the type of the parameter, and performs corresponding operation on the browser according to the execution logic.
Optionally, the browser may determine the type of the parameter, determine a corresponding execution logic from the script code according to the type of the parameter, and further perform a corresponding operation on the browser according to the execution logic. For example, when the type of the parameter is a new window opening type, a first execution logic corresponding to the new window opening type is determined from the script code, and a new window is opened on the browser according to the first execution logic; when the type of the parameter is the HTTP request type, determining a second execution logic corresponding to the HTTP request type from the script code, and performing data interaction between the server and the embedded page according to the second execution logic; and when the type of the parameter is to call other plug-ins or other interface types, determining a third execution logic corresponding to the calling of the other plug-ins or other interface types from the script code, and calling the other plug-ins or other interfaces on the browser according to the third execution logic.
That is to say, after the browser obtains the parameters transferred when the embedded page calls the interface, the type of the parameters can be determined, then the execution logic corresponding to the type of the parameters is determined from the script code according to the type of the parameters, and the operation is executed according to the execution logic, so that the behavior of the Window container in the prior art is handed to the browser to be realized, and the method comprises the steps of opening a new Window, positioning a specific anchor point, sending a request to a specified server and the like.
Three examples will be given below for understanding:
in an embodiment of the present invention, taking the type of the parameter as the type of opening a new window as an example, optionally, when the browser determines that the type of the parameter is the type of opening a new window, determining a first execution logic corresponding to the type of opening the new window from the script code, determining whether an anchor point exists in the parameter according to the first execution logic, if so, opening the new window on the browser, and positioning to a specific position in the new window according to the anchor point; and if not, directly opening a new window on the browser.
For example, open "news a" web page, click on the link to "news a 1" in the "news a" web page, where the URL link is: http:// file path/index. html # foot, the browser can obtain a parameter in a news A1 link and determine that the parameter type is a new window opening type, the browser can determine that a first execution logic corresponding to the new window opening type is a new window opening type from the script code, determine whether an anchor point exists in the parameter according to the first execution logic, if so, open the new window on the browser, and position to a specific position in the new window according to the anchor point, if so, present a news A1 page in the new window, and position to a corresponding position directly on the news A1 page according to the anchor point; if not, a new window is opened directly on the browser, such as presenting a "news A1" page in the new window.
In another embodiment of the present invention, taking the type of the parameter as an HTTP request type as an example, optionally, when the browser determines that the parameter type is the HTTP request type, determining a second execution logic corresponding to the HTTP request type from the script code, sending an asynchronous HTTP request to the server according to the second execution logic and the parameter, and when it is determined that the asynchronous HTTP request is successfully sent, triggering a predefined notification event, where the notification event is used to indicate that when the server returns data for the asynchronous HTTP request, the returned data is sent to the notification event as the parameter, monitoring the notification event, acquiring the data returned by the server according to the parameter in the notification event, and sending the data returned by the server to the embedded page.
That is to say, when the browser determines that the parameter type is the HTTP request type, a second execution logic corresponding to the HTTP request type is determined from the script code, an asynchronous HTTP request is sent to the server according to the second execution logic and the parameter, a notification event is actively triggered after the asynchronous request is successful, for example, the notification event is named "my-event", and the event is monitored, and then the result is sent to the embedded page as the parameter, and the browser and the embedded page can directly interact. Therefore, the problem of frequent occupation of the browser thread for a long time can be avoided through the asynchronous request, and the browser performance is improved.
In another embodiment of the present invention, taking the type of the parameter as an example of invoking another plug-in or another interface type, optionally, when the browser determines that the parameter type is invoking another plug-in or another interface type, a third execution logic corresponding to invoking the another plug-in or another interface type is determined from the script code, and the another plug-in or another interface is invoked on the browser according to the third execution logic.
For example, open "shopping a" webpage, click on the link of "commodity a 1" in "shopping a" webpage, where the link is: invoking plug-in parameters, wherein the browser can obtain parameters in a commodity A1 link, determine the parameter type as other plug-in invoking types, determine a first execution logic corresponding to the type of opening the new window as the plug-in invoking type from the script code, and invoke other plug-ins on the browser according to a third execution logic.
In order to make the difference between the present invention and the prior art more clear for those skilled in the art, the following method for processing the HTML5 page in the prior art and the method for processing the HTML5 page in the embodiment of the present invention are described separately.
Fig. 2 is a diagram illustrating an example of processing an application inline HTML5 page in the prior art. As shown in FIG. 2, in the prior art, inline HTML5 pages are embedded in a Window container that provides the interface and execution logic for inline HTML5 pages. When the embedded HTML5 page calls an interface provided by the Window container, the embedded HTML5 page transmits related parameters to the Window container, and the Window container performs different operations according to the types of the parameters. It can be seen that all interactions, styles and requests are completed in the Window container by the embedded HTML5 page; moreover, the Window container is embedded with the HTML5 page, and the Window container and the HTML5 page are developed at the same time, so that the development efficiency is reduced, and the later code maintenance cost is high.
Fig. 3 is a diagram illustrating an example of processing an application inline HTML5 page according to an embodiment of the present invention. As shown in FIG. 3, by installing a container simulation plug-in on a browser, when an embedded HTML5 page is opened, an embodiment of the invention injects script code into an embedded HTML5 page through the container simulation plug-in, wherein the script code is usable for simulating the interface and execution logic of a Window container. When determining that the embedded HTML5 page calls the interface in the script code, the browser can acquire parameters transmitted when the embedded HTML5 page calls the interface; in the embodiment of the present invention, the parameters include, but are not limited to, a parameter carrying a new window to be opened, a parameter carrying an HTTP request, a parameter carrying other plug-ins or interfaces to be invoked, and the like. After the browser acquires the parameters transmitted when the embedded HTML5 page calls the interface, the type of the parameters can be determined, then the execution logic corresponding to the type of the parameters is determined from the script codes according to the type of the parameters, and the operation is executed according to the execution logic, so that the behavior of the Window container in the prior art is realized by the browser, including opening a new Window, positioning a specific anchor point, sending a request to a specified server and the like. It can be seen that by installing a simulation plug-in on the browser to simulate all interfaces and execution logic of the window container, the behavior of the container can be simulated on the browser, and the direct interaction between the embedded HTML5 page and the browser can be realized, so that the development and debugging on the browser can be realized, the development efficiency is improved, and the cost of later maintenance is saved.
For example, as shown in fig. 4, when the application embedded HTML5 page is opened, the container simulation plug-in injects script code into the embedded HTML5 page, where the script code is used to simulate the interface and execution logic of the Window container (S410), then judges whether the interface in the embedded HTML5 page call script code exists (S420), if not, throws an exception (S430), if so, the browser obtains the parameters passed when the embedded HTML5 page calls the interface, and judges the parameter type (S440), if the parameter type is the type of opening a new Window (S450), judges whether the anchor point position exists in the parameters (S460), if not, directly opens the new Window (S470), if so, opens the new Window and locates to a specific position (S480); if the parameter type is the HTTP request type (S490), judging whether the parameters needing to be transmitted by the request interface exist (S500), if not, throwing an exception (S510), if so, directly sending the request to the server (S520), then judging whether the request is sent successfully (S530), if not, throwing an exception (S540), and if so, sending the data returned by the server to the embedded HTML5 page (S550); if the parameter type is to call other plug-ins or other interface types (S560), other plug-ins or other interfaces are called on the browser (S570).
According to the processing method of the application program embedded page, when the application program embedded page is opened, the container simulation plug-in injects the script code into the embedded page, wherein the script code is used for simulating the interface and the execution logic of a Window container, then when the embedded page calls the interface in the script code, the browser obtains the parameters transmitted when the embedded page calls the interface, then the browser determines the corresponding execution logic from the script code according to the types of the parameters, and corresponding operation is carried out on the browser according to the execution logic. The method is characterized in that a simulation plug-in is installed on a browser to simulate all interfaces and execution logic of a window container, so that the behavior of the container can be simulated on the browser, direct interaction between an embedded page and the browser is realized, and development and debugging can be realized on the browser; in addition, the embedded page and the window container are developed and decoupled, so that complete isolation is achieved, and non-interfering parallel development is achieved, the embedded page code can normally run on a browser and can also normally run in the window container, a set of embedded page code can run on a plurality of platforms, the development efficiency can be greatly improved, and the later maintenance cost is saved.
Corresponding to the methods for processing the application embedded page provided in the foregoing embodiments, an embodiment of the present invention further provides a browser, and since the browser provided in the embodiment of the present invention corresponds to the methods for processing the application embedded page provided in the foregoing embodiments, the implementation method of the method for processing the application embedded page is also applicable to the browser provided in the embodiment, and will not be described in detail in this embodiment. Fig. 5 is a schematic structural diagram of a browser according to an embodiment of the present invention. As shown in fig. 5, the browser includes: a container simulation plug-in 510, a parameter acquisition module 520, and a processing module 530, wherein:
the container simulation plug-in 510 is used for injecting script code into the embedded page when the embedded page of the application program is opened, wherein the script code is used for simulating an interface and execution logic of the Window container. As an example, the inline page is an HTML5 page.
The parameter obtaining module 520 is configured to, when it is determined that the embedded page calls the interface in the script code, obtain, by the browser, a parameter transmitted when the embedded page calls the interface.
The processing module 530 is configured to, when it is determined that the embedded page calls the interface in the script code, obtain, by the browser, a parameter transmitted when the embedded page calls the interface.
In one embodiment of the invention, the processing module comprises: the device comprises a parameter type determining and unit processing unit, wherein the parameter type determining unit is used for determining the type of the parameter; the processing unit is used for determining a first execution logic corresponding to the type of the opened new window from the script code when the type of the parameter is the type of the opened new window, and opening the new window on the browser according to the first execution logic; when the type of the parameter is an HTTP request type, determining a second execution logic corresponding to the HTTP request type from the script code, and performing data interaction between the server and the embedded page according to the second execution logic; and when the type of the parameter is to call other plug-ins or other interface types, determining a third execution logic corresponding to the calling of the other plug-ins or other interface types from the script code, and calling the other plug-ins or other interfaces on the browser according to the third execution logic.
In an embodiment of the present invention, a specific implementation process of the processing unit opening a new window on the browser according to the first execution logic may be as follows: determining whether an anchor point exists in the parameters according to the first execution logic; if so, opening a new window on the browser, and positioning to a specific position in the new window according to the anchor point; and if not, directly opening a new window on the browser.
In an embodiment of the present invention, a specific implementation process of the processing unit performing data interaction between the server and the embedded page according to the second execution logic may be as follows: sending an asynchronous HTTP request to the server according to the second execution logic and the parameters; when the asynchronous HTTP request is determined to be successfully sent, triggering a predefined notification event, wherein the notification event is used for indicating that when the server returns data aiming at the asynchronous HTTP request, the returned data is transmitted into the notification event as a parameter; and monitoring the notification event, acquiring data returned by the server according to parameters in the notification event, and sending the data returned by the server to the embedded page.
According to the browser provided by the embodiment of the invention, when the embedded page of the application program is opened, the container simulation plug-in injects the script code into the embedded page, wherein the script code is used for simulating the interface and the execution logic of the Window container, then when the embedded page calls the interface in the script code, the browser obtains the parameters transmitted when the embedded page calls the interface, then the browser determines the corresponding execution logic from the script code according to the types of the parameters, and performs corresponding operation on the browser according to the execution logic. Therefore, by installing the simulation plug-in on the browser to simulate all interfaces and execution logic of the window container, the behavior of the container can be simulated on the browser, and the direct interaction between the embedded page and the browser is realized, so that the development and debugging on the browser can be realized; in addition, the embedded page and the window container are developed and decoupled, so that complete isolation is achieved, and non-interfering parallel development is achieved, the embedded page code can normally run on a browser and can also normally run in the window container, a set of embedded page code can run on a plurality of platforms, the development efficiency can be greatly improved, and the later maintenance cost is saved.
In order to implement the above-mentioned embodiments, the present invention also proposes a computer device,
FIG. 6 is a schematic diagram of a computer device according to one embodiment of the invention. As shown in fig. 6, the computer device 600 may include: the memory 610, the processor 620 and the computer program 630 stored in the memory 610 and capable of running on the processor 620, when the processor 620 executes the program, the method for processing the application embedded page according to any one of the above embodiments of the present invention is implemented.
In order to implement the foregoing embodiments, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for processing the application embedded page according to any one of the foregoing embodiments of the present invention.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (12)

1. A processing method for an embedded page of an application program is applied to a browser, the browser is provided with a container simulation plug-in, and the method comprises the following steps:
when the embedded page of the application program is opened, the container simulation plug-in injects script codes into the embedded page, wherein the script codes are used for simulating an interface and execution logic of a Window container;
when the embedded page is determined to call the interface in the script code, the browser acquires parameters transmitted when the embedded page calls the interface;
and the browser determines a corresponding execution logic from the script code according to the type of the parameter, and performs corresponding operation on the browser according to the execution logic.
2. The method according to claim 1, wherein the browser determines a corresponding execution logic from the script code according to the type of the parameter, and performs a corresponding operation on the browser according to the execution logic, including:
the browser determines the type of the parameter;
when the type of the parameter is a new window opening type, determining a first execution logic corresponding to the new window opening type from the script code, and opening a new window on the browser according to the first execution logic;
when the type of the parameter is an HTTP request type, determining a second execution logic corresponding to the HTTP request type from the script code, and performing data interaction between the server and the embedded page according to the second execution logic;
when the type of the parameter is to call other plug-ins or other interface types, determining a third execution logic corresponding to the calling of the other plug-ins or other interface types from the script code, and calling the other plug-ins or other interfaces on the browser according to the third execution logic.
3. The method of claim 2, wherein opening a new window on the browser according to the first execution logic comprises:
determining whether an anchor point exists in the parameters according to the first execution logic;
if so, opening a new window on the browser, and positioning to a specific position in the new window according to the anchor point;
and if not, directly opening a new window on the browser.
4. The method of claim 2 or 3, wherein the performing data interaction between the server and the embedded page according to the second execution logic comprises:
sending an asynchronous HTTP request to the server according to the second execution logic and the parameters;
when the asynchronous HTTP request is determined to be successfully sent, triggering a predefined notification event, wherein the notification event is used for indicating that when the server returns data aiming at the asynchronous HTTP request, the returned data is transmitted into the notification event as a parameter;
and monitoring the notification event, acquiring data returned by the server according to parameters in the notification event, and sending the data returned by the server to the embedded page.
5. The method of claim 1, wherein the inline page is an HTML5 page.
6. A browser, comprising:
the system comprises a container simulation plug-in, a script code and a Window execution module, wherein the container simulation plug-in is used for injecting the script code into an embedded page of an application program when the embedded page is opened, and the script code is used for simulating an interface and execution logic of a Window container;
the parameter acquisition module is used for acquiring parameters transmitted when the embedded page calls the interface when determining that the embedded page calls the interface in the script code;
and the processing module is used for determining the corresponding execution logic from the script code by the browser according to the type of the parameter and performing corresponding operation on the browser according to the execution logic.
7. The browser of claim 6, wherein the processing module comprises:
a parameter type determining unit for determining the type of the parameter;
the processing unit is used for determining a first execution logic corresponding to the type of the opened new window from the script code when the type of the parameter is the type of the opened new window, and opening the new window on the browser according to the first execution logic; when the type of the parameter is an HTTP request type, determining a second execution logic corresponding to the HTTP request type from the script code, and performing data interaction between the server and the embedded page according to the second execution logic; and when the type of the parameter is to call other plug-ins or other interface types, determining a third execution logic corresponding to the calling of the other plug-ins or other interface types from the script code, and calling the other plug-ins or other interfaces on the browser according to the third execution logic.
8. The browser according to claim 7, wherein the processing unit is specifically configured to:
determining whether an anchor point exists in the parameters according to the first execution logic;
if so, opening a new window on the browser, and positioning to a specific position in the new window according to the anchor point;
and if not, directly opening a new window on the browser.
9. The browser according to claim 7 or 8, wherein the processing unit is further specifically configured to:
sending an asynchronous HTTP request to the server according to the second execution logic and the parameters;
when the asynchronous HTTP request is determined to be successfully sent, triggering a predefined notification event, wherein the notification event is used for indicating that when the server returns data aiming at the asynchronous HTTP request, the returned data is transmitted into the notification event as a parameter;
and monitoring the notification event, acquiring data returned by the server according to parameters in the notification event, and sending the data returned by the server to the embedded page.
10. The browser of claim 6, wherein the embedded page is an HTML5 page.
11. A computer device, comprising: the system comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the processor realizes the application embedded page processing method according to any one of claims 1 to 5.
12. A computer-readable storage medium on which a computer program is stored, the computer program, when being executed by a processor, implementing an application inline page processing method according to any one of claims 1 to 5.
CN201910395368.5A 2019-05-13 2019-05-13 Application program embedded page processing method, browser, equipment and storage medium Active CN110188296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910395368.5A CN110188296B (en) 2019-05-13 2019-05-13 Application program embedded page processing method, browser, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910395368.5A CN110188296B (en) 2019-05-13 2019-05-13 Application program embedded page processing method, browser, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110188296A CN110188296A (en) 2019-08-30
CN110188296B true CN110188296B (en) 2021-07-13

Family

ID=67716099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910395368.5A Active CN110188296B (en) 2019-05-13 2019-05-13 Application program embedded page processing method, browser, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110188296B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783642A (en) * 2019-11-11 2021-05-11 阿里巴巴集团控股有限公司 In-container logic configuration method, device and computer readable medium
CN111223540A (en) * 2020-01-08 2020-06-02 智业软件股份有限公司 Method and system for embedding local application program into WEB application
CN112965895B (en) * 2021-02-07 2023-12-08 卫宁健康科技集团股份有限公司 Desktop application program automatic test method, device, equipment and storage medium
CN114816558B (en) * 2022-03-07 2023-06-30 深圳市九州安域科技有限公司 Script injection method, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159677A (en) * 2015-09-09 2015-12-16 深圳Tcl数字技术有限公司 Controlled display method of terminal user interface and controlled display device of terminal user interface
CN106325948A (en) * 2016-08-27 2017-01-11 飞天诚信科技股份有限公司 Method and device for supporting existing Web applications through mobile platform
CN108345535A (en) * 2017-12-26 2018-07-31 阿里巴巴集团控股有限公司 Mock test methods, device and equipment
CN109032705A (en) * 2018-07-05 2018-12-18 腾讯科技(深圳)有限公司 Execution method, apparatus, electronic equipment and the readable storage medium storing program for executing of application program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814157B2 (en) * 2000-01-11 2010-10-12 Eolas Technlogies, Inc. Hypermedia browser API simulation to enable use of browser plug-ins and applets as embedded widgets in script-language-based interactive programs
CN102819451B (en) * 2011-06-09 2015-08-19 财付通支付科技有限公司 A kind of browser plug-in call method and system
CN104253788B (en) * 2013-06-26 2019-07-16 腾讯科技(深圳)有限公司 A kind of data processing method, client, page engine and system
US9734519B2 (en) * 2014-12-29 2017-08-15 Excalibur Ip, Llc Native advertisement smart injection
CN107948148B (en) * 2017-11-21 2021-05-07 北京天融信网络安全技术有限公司 Method and device for simulating replacement filling

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159677A (en) * 2015-09-09 2015-12-16 深圳Tcl数字技术有限公司 Controlled display method of terminal user interface and controlled display device of terminal user interface
CN106325948A (en) * 2016-08-27 2017-01-11 飞天诚信科技股份有限公司 Method and device for supporting existing Web applications through mobile platform
CN108345535A (en) * 2017-12-26 2018-07-31 阿里巴巴集团控股有限公司 Mock test methods, device and equipment
CN109032705A (en) * 2018-07-05 2018-12-18 腾讯科技(深圳)有限公司 Execution method, apparatus, electronic equipment and the readable storage medium storing program for executing of application program

Also Published As

Publication number Publication date
CN110188296A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN110188296B (en) Application program embedded page processing method, browser, equipment and storage medium
US11132287B2 (en) Synthetic test recorder installed inline with a web portal
US8433733B2 (en) Web application record-replay system and method
US9229844B2 (en) System and method for monitoring web service
CN102833212B (en) Webpage visitor identity identification method and system
CN105975856B (en) A kind of mobile terminal virus dynamic testing method and system
CN104899131B (en) Detection method, device and the mobile terminal that webpage loads in a kind of pair of browser
CN109739711B (en) Interface test method, device, equipment and storage medium
US20190377877A1 (en) Web browser script monitoring
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN111611140B (en) Report verification method and device for buried point data, electronic equipment and storage medium
CN111538922B (en) Link jump method, application client, device and storage medium
CN107844486B (en) Method and system for analyzing webpage problems for client
CN111666199B (en) Debugging method executed on intelligent terminal and software debugger
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN112543478B (en) WiFi module automatic test method and device, computer equipment and storage medium
CN109697164A (en) Test method, device, storage medium and the terminal of App have been adjusted in browser
CN107026854B (en) Vulnerability verification method and device
CN110928787B (en) Automatic test script recording and playback method, device, equipment and storage medium
CN107766068A (en) Application system patch installation, device, computer equipment and storage medium
KR20120071175A (en) Mobile phone loading web-platform, method for offering log information using the same mobile phone, verification system and method for web-platform
CN107590062B (en) Multi-client interaction testing method and device
CN115514677B (en) Method and system for server dial testing
CN108400901B (en) Application testing method, terminal device and computer readable storage medium
CN103019927B (en) A kind of performance test methods and system

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
GR01 Patent grant
GR01 Patent grant