CN112988410A - Calling method and device of browser extension interface, terminal and storage medium - Google Patents

Calling method and device of browser extension interface, terminal and storage medium Download PDF

Info

Publication number
CN112988410A
CN112988410A CN201911321780.9A CN201911321780A CN112988410A CN 112988410 A CN112988410 A CN 112988410A CN 201911321780 A CN201911321780 A CN 201911321780A CN 112988410 A CN112988410 A CN 112988410A
Authority
CN
China
Prior art keywords
browser
calling
command
layer
kernel layer
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
CN201911321780.9A
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.)
Shenzhen Yayue Technology Co ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911321780.9A priority Critical patent/CN112988410A/en
Publication of CN112988410A publication Critical patent/CN112988410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • 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/448Execution paradigms, e.g. implementations of programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

A calling method, a calling device, a calling terminal and a calling storage medium of a browser extension interface are provided. The browser extension interface sends a calling request to a browser kernel layer, wherein the calling request comprises a calling command and command parameters; the browser kernel layer forwards the call request to the browser control layer; the browser control layer analyzes the command parameters, executes the call command by using the command parameters, and sends a call result to the browser kernel layer; and the browser kernel layer forwards the calling result to the browser extension interface. By adopting the scheme of the application, when the call command of the expansion interface is executed by the browser control layer, the browser kernel layer does not process the call request, and only forwards the call request and the call result, so that the kernel does not need to be recompiled by the browser kernel layer, the development efficiency is improved, and the browser control layer executes the call command, so that the call command depends on the control version and does not depend on the kernel version.

Description

Calling method and device of browser extension interface, terminal and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a browser extension interface calling method, a browser extension interface calling device, a terminal, and a computer storage medium.
Background
The chrome browser extension interface is a special set of JavaScript call interfaces provided by chrome. Based on the mechanism, the browser can customize the expansion interface of the browser.
Currently, a Chromium browser extension interface is directly used to process JavaScript code calling at a browser kernel layer. Fig. 1 is a schematic diagram of a process architecture of a chrome Browser, in which a Browser process is used as a main process to implement functions such as User Interface (UI) logic (including related UI logic such as tags and bookmarks), data management, and the like; rendering (Render) processes, extension processes, GPU processes, and other processes for each web page are also managed. However, when the interface of the chrome browser is directly used, the kernel needs to be recompiled every time the interface is added or modified, which reduces the development efficiency.
The browser related to the application adopts a shell-core separation architecture, and separates a UI (comprising UI logic and a UI library) from a kernel as shown in FIG. 2. And a UI process is added, and UI logic related to the main interface is transplanted to the UI process. And after modification, the UI process is a main process, and the life cycle of the Browser process is controlled by the UI process. The UI process and the Browser process communicate with each other through inter-process communication (IPC), which is mainly data transfer. The new process architecture does not change the original process architecture of the chrome, only cuts partial codes in the Browser process, and newly adds a cross-process communication module.
Under this "shell-core separated" browser architecture, some JavaScript call logic relies on the control (frame) layer, which may cause call failure if the kernel version and the frame version do not match.
Therefore, the problem of how to call the extension interface under the browser architecture of "shell-core separation" needs to be solved, so that the development efficiency is improved, and the problem that the kernel version is inconsistent with the frame version is avoided.
Disclosure of Invention
The embodiment of the application provides a calling method, a calling device, a calling terminal and a calling storage medium of a browser extension interface.
In a first aspect, a method for calling a browser extension interface is provided, including:
the method comprises the steps that a browser extension interface sends a first calling request to a browser kernel layer, wherein the first calling request comprises a calling command and command parameters;
the browser kernel layer forwards the first calling request to a browser control layer;
the browser control layer analyzes the command parameters, executes the calling command by using the command parameters, and sends the calling result to the browser kernel layer;
and the browser kernel layer forwards the calling result to the browser extension interface.
In one implementation, the method further comprises:
and the browser extension interface sends a checking instruction to the browser kernel layer through a first interface, wherein the checking instruction is used for indicating whether the browser control layer supports the execution of the call command by using the command parameter.
In yet another implementation, the browser extension interface sending a first invocation request to the browser kernel layer, including:
and if the browser control layer supports the use of the command parameter to execute the call command, the browser expansion interface sends the call command to the browser kernel layer through a second interface.
In yet another implementation, the first call request received by the browser kernel layer includes a callback function; the browser kernel layer forwards the first call request to a browser control layer, and the method comprises the following steps:
the browser kernel layer forwards the first calling request to a browser control layer through inter-process communication, wherein the forwarded first calling request further comprises a first identifier, and the first identifier is associated with the callback function;
the browser control layer sends the calling result to the browser kernel layer, and the calling result comprises the following steps:
and the browser control layer sends the calling result to the browser kernel layer through interprocess communication, wherein the calling result also comprises the first identifier.
In yet another implementation, the first invocation request is an invocation request associated with the browser control layer.
In yet another implementation, the call command is to open a dialog box, and the command parameter is to open an "import bookmark" panel.
In yet another implementation, the method further comprises:
the browser extension interface sends a second calling request to the browser kernel layer, wherein the second calling request comprises a calling command and a command parameter, and the second calling request is a calling request associated with the browser kernel layer;
and the browser kernel layer analyzes the command parameters, executes the calling command by using the command parameters, and sends a calling result to the browser extension interface.
In a second aspect, an apparatus for invoking a browser extension interface is provided, including: the browser comprises a browser expansion interface, a browser kernel layer and a browser control layer;
the browser extension interface is used for sending a first calling request to the browser kernel layer, wherein the first calling request comprises a calling command and command parameters;
the browser kernel layer is used for forwarding the first calling request to the browser control layer;
the browser control layer is used for analyzing the command parameters, executing the calling command by using the command parameters and sending the calling result to the browser kernel layer;
and the browser kernel layer is also used for forwarding the calling result to the browser expansion interface.
In one implementation, the browser extension interface is configured to send a check instruction to the browser kernel layer through the first interface, where the check instruction is configured to instruct to check whether the browser control layer supports executing the call command using the command parameter.
In yet another implementation, the browser extension interface is configured to send the call command to the browser kernel layer through a second interface if the browser control layer supports executing the call command using the command parameter.
In yet another implementation, the first call request received by the browser kernel layer includes a callback function;
the browser kernel layer is used for forwarding the first call request to the browser control layer through interprocess communication, the forwarded first call request further comprises a first identifier, and the first identifier is associated with the callback function;
the browser control layer is used for sending the calling result to the browser kernel layer through interprocess communication, and the calling result further comprises the first identifier.
In yet another implementation, the first invocation request is an invocation request associated with the browser control layer.
In yet another implementation, the call command is to open a dialog box, and the command parameter is to open an "import bookmark" panel.
In yet another implementation, the browser extension interface is further configured to send a second invocation request to the browser kernel layer, where the second invocation request includes an invocation command and a command parameter, and the second invocation request is an invocation request associated with the browser kernel layer;
the browser kernel layer is further used for analyzing the command parameters, executing the call command by using the command parameters, and sending a call result to the browser extension interface.
In a third aspect, a terminal is provided, which includes an input device and an output device, and further includes:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
a memory storing one or more instructions adapted to be loaded by the processor and to execute a method of invoking a browser extension interface as described in the first aspect or any of the first aspects.
In a fourth aspect, a computer-readable storage medium is provided, which stores one or more instructions adapted to be loaded by a processor and execute a method for invoking a browser extension interface according to the first aspect or any one of the first aspects.
By adopting the technical scheme, the method has the following beneficial effects:
when the call command of the expansion interface is to be executed by the browser control layer, the browser kernel layer does not process the call request, and only forwards the call request and the call result, so that the kernel does not need to be recompiled by the browser kernel layer, the development efficiency is improved, and the browser control layer executes the call command, so that the call command depends on the control version and does not depend on the kernel version.
Drawings
FIG. 1 is a schematic diagram of a chrome browser architecture;
FIG. 2 is a schematic view of a browser architecture with shell and core separation according to the present application;
fig. 3 is a schematic flowchart of a method for calling a browser extension interface according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a method for calling a browser extension interface according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for invoking a browser extension interface according to the related art;
FIG. 6 is a schematic diagram of a control entry with a command parameter of "import bookmark by one key";
FIG. 7 is a schematic diagram of a control opened after clicking the "import bookmark with one key" control;
FIG. 8 is a schematic diagram illustrating a control popping-up prompt when it is detected that the current browser version does not support "import bookmark by one key";
fig. 9 is a schematic structural diagram of a calling device of a browser extension interface according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In the embodiment of the present application, a Browser architecture of "shell-core separation" shown in fig. 2 is adopted, and a UI process is used as a main process to control the life cycle of a Browser process. The UI process and the Browser process are communicated through IPC, and data is mainly transferred. The UI process includes UI logic and a UI library. The Browser process manages the rendering process, the extension process, the GPU process, and other processes of each web page.
The JavaScript extension interface can be added or modified based on the browser architecture. The JavaScript extension interface can be customized as needed.
As shown in fig. 3, a schematic flowchart of a method for invoking a browser extension interface according to an embodiment of the present application is provided, where the method may include:
s101, the browser extension interface sends a first calling request to the browser kernel layer, wherein the first calling request comprises a calling command and command parameters.
The browser extension interface (hereinafter referred to as "extension interface") may be a JavaScript extension interface.
When a user triggers the extension interface to call or an internal timer of the terminal triggers the extension interface to call, the extension interface sends a first call request to a browser kernel layer. The first call request includes a call Command (CMD) and command parameters (ARGS). Wherein CMD represents a command name called by the extension interface (e.g., openDialog); ARGS represents the command parameters (e.g., { dialogName: 'importBookmark' (open "import bookmark" panel) }) that the extended interface calls.
The method is based on a shell-core separation framework, a chrome frame command interface is provided in a browser kernel layer (hereinafter referred to as the kernel layer), and an extension interface sends the first call request to the kernel layer through the interface.
S102, the browser kernel layer forwards the first calling request to the browser control layer.
The first call request is a call request associated with a control layer, the call logic of which depends on the control layer. Therefore, the kernel layer does not process the first call request, does not need to recompile the kernel, and forwards the first call request to the control layer.
Specifically, the browser kernel layer forwards the first call request to the browser control layer through the IPC. Of course, the browser kernel layer and the browser control layer are not limited to the IPC communication mode.
S103, the browser control layer analyzes the command parameters and executes the calling command by using the command parameters.
And the control layer receives the first calling request, analyzes the first calling request and acquires a calling command and command parameters in the first calling request. And executes the call command using the command parameters.
As in the above example, the call command is "open dialog", the command parameter is "open" import bookmark "panel", the control layer opens the dialog, and the call opens the "import bookmark" panel.
And S104, the browser control layer sends a calling result to the browser kernel layer.
And after executing the calling command, the control layer sends a calling result to the kernel layer.
Specifically, the browser control layer sends a calling result to the browser kernel layer through the IPC. Of course, the browser kernel layer and the browser control layer are not limited to the IPC communication mode.
S105, the browser kernel layer forwards the calling result to the browser extension interface.
The kernel layer does not process the calling result and forwards the calling result to the expansion interface. After the extension interface obtains the calling result, it can be known that the control layer executes the calling request.
After the scheme is used, for example, for the requirement that a novice guide page is added with a button of 'one-key bookmark' the development cost on the client side of the browser is reduced from the original 2 days to 0.5 day (calculated according to 8 hours every day), and the development cost is greatly reduced.
According to the calling method of the browser extension interface provided by the embodiment of the application, when the extension interface calling command is executed by the browser control layer, the browser kernel layer does not process the calling request, only forwards the calling request and the calling result, so that the kernel does not need to be recompiled by the browser kernel layer, the development efficiency is improved, and the browser control layer executes the calling command, so that the calling command depends on the control version and does not depend on the kernel version.
As shown in fig. 4, a schematic flowchart of a method for invoking a browser extension interface provided in an embodiment of the present application is shown, where the method may include:
s201, the browser extension interface sends a checking instruction to the browser kernel layer through the first interface, and the checking instruction is used for indicating whether the browser control layer supports the execution of the call command by using the command parameter.
The control layer does not support the case of executing the call command by using the command parameter, so that the control layer can be requested to check whether the call command is executed or not before the extension interface sends the call request to the control layer.
In this embodiment, the extension interface may send a check instruction to the kernel layer through the first interface, where the check instruction is used to instruct the control layer to check whether the execution of the call command using the command parameter is supported, or to check whether the current client version supports a certain function.
The first interface may specifically be an isSupported interface, and the chrome. For example, chrome.
S202, the browser kernel layer forwards the check instruction to the browser control layer through interprocess communication.
The sending flow of the check instruction is the same as that of the first calling request, the kernel layer does not process the check instruction, and the check instruction is forwarded to the control layer through IPC.
S203, the browser control layer checks whether the browser control layer supports the use of the command parameter to execute the call command according to the check instruction.
And checking whether the current client supports executing the call command, specifically, checking whether the control layer supports executing the call command. If the version of the client is not upgraded, the control layer may not support the call command; if the client has been upgraded, the control layer may support execution of the call command.
And S204, the browser control layer sends the check result to the browser kernel layer through interprocess communication.
And the control layer returns the check result to the kernel layer through IPC. The check result includes support for executing the call command or support for executing the call command.
S205, the browser kernel layer sends the check result to the browser extension interface.
The kernel layer does not process the checking result and forwards the checking result to the expansion interface.
In one implementation, in S201 above, the check instruction may further include a first callback function (callback). And in S202, the kernel layer includes a second identifier (REQ _ ID2) in the check instruction sent to the control layer, where the second identifier is associated with the first callback function. In S205, the kernel layer may find the first callback function corresponding to the check instruction according to the second identifier, and send the first callback function to the extension interface, where the first callback function includes the check result.
If the scheme is not used, under the framework of 'shell-core separation', the problem of call failure caused by the fact that the versions of the kernel layer and the control layer are not matched can be solved; however, if the scheme is used, before the invoke command is used, whether the current control layer is supported or not can be checked in advance through the isSupported interface, and failure caused by the attempt of invoking is avoided. For example, without using the scheme, as shown in fig. 5, in a client that cannot open the "import bookmark" front edition, calling a chrome.
The front-end code of the new hand-guided page can check whether the current browser client supports opening the 'import bookmark' edition, and different operation strategies are used for different browser users (for example, the browser is prompted to be updated by the unsupported user instead of being directly called in the code), so that the loss of the user is recovered.
And S206, if the browser control layer supports the execution of the call command by using the command parameter, the browser expansion interface sends a first call request to the browser kernel layer through the second interface, wherein the first call request comprises the call command and the command parameter.
S207, the browser kernel layer forwards the first calling request to the browser control layer through interprocess communication.
And S208, the browser control layer analyzes the command parameters and executes the calling command by using the command parameters.
S209, the browser control layer sends the calling result to the browser kernel layer through interprocess communication.
S210, the browser kernel layer sends a calling result to the browser extension interface.
S206 to S210 are processes for sending the first call request, and are substantially the same as S101 to S105 in the embodiment shown in fig. 3. In contrast, in S206, the first call request may include a second callback function, and the second interface may be an invoke interface. The invoke interface is used for invoking commands, such as chrome, frame command, invoke (' openDialog), { dialname: ' importBookmark ', callback }, and indicates that the "import bookmark" panel is invoked to open. And in S207, the first call request sent by the kernel layer to the control layer includes a first identifier (REQ _ ID1), where the first identifier is associated with the second callback function. In S210, the kernel layer may find the second callback function according to the first identifier, and send the second callback function to the extension interface, where the second callback function includes the call result.
Further, for the extension interface which is not related to the control layer, the kernel layer executes the calling command. The method may further comprise:
the browser extension interface sends a second calling request to the browser kernel layer, wherein the second calling request comprises a calling command and a command parameter, and the second calling request is a calling request associated with the browser kernel layer;
and the browser kernel layer analyzes the command parameters, executes the calling command by using the command parameters and sends a calling result to the browser extension interface.
According to the calling method of the browser extension interface, when an extension interface calling command is executed by a browser control layer, a browser kernel layer does not process a calling request, only forwards the calling request and a calling result, so that the kernel does not need to be recompiled by the browser kernel layer, the development efficiency is improved, and the browser control layer executes the calling command, so that the calling command depends on a control version and does not depend on the kernel version; and before using the second interface to call the command, whether the current control layer supports the call command can be checked through the first interface in advance, so that failure caused by calling attempt is avoided.
In a specific example, as shown in fig. 6, the bookmark importing entry of the novice guidance page provides a JavaScript extension interface in the novice guidance page of the first browser, supports opening of a "bookmark importing" aspect of the browser, and can import bookmarks of multiple browsers, such as the second browser to the fifth browser. As shown in fig. 7, the panel opened by clicking the "bookmark import by one key" button can select a plurality of browsers such as the second browser to the fifth browser and the local bookmark import. If the page detects that the current browser version does not support the "import bookmark" version, a prompt to "download the latest version of the first browser" will pop up as shown in fig. 8.
Based on the same concept of the method for calling the browser extension interface, an embodiment of the present application further provides a schematic structural diagram of a device for calling the browser extension interface, and as shown in fig. 9, the device 1000 includes a browser extension interface 101, a browser kernel layer 102, and a browser control layer 103. Wherein:
the browser extension interface 101 is configured to send a first call request to a browser kernel layer, where the first call request includes a call command and a command parameter;
the browser kernel layer 102 is configured to forward the first call request to a browser control layer;
the browser control layer 103 is configured to parse the command parameter, execute the call command using the command parameter, and send the call result to the browser kernel layer;
the browser kernel layer 102 is further configured to forward the call result to the browser extension interface.
In one implementation, the browser extension interface 101 is configured to send a check instruction to the browser kernel layer through the first interface, where the check instruction is configured to instruct to check whether the browser control layer supports executing the call command using the command parameter.
In yet another implementation, the browser extension interface 101 is configured to send the call command to the browser kernel layer through a second interface if the browser control layer supports executing the call command using the command parameter.
In yet another implementation, the first call request received by the browser kernel layer 102 includes a callback function;
the browser kernel layer 102 is configured to forward the first call request to a browser control layer through inter-process communication, where the forwarded first call request further includes a first identifier, and the first identifier is associated with the callback function;
the browser control layer 103 is configured to send the call result to the browser kernel layer through inter-process communication, where the call result further includes the first identifier.
In yet another implementation, the first invocation request is an invocation request associated with the browser control layer.
In yet another implementation, the call command is to open a dialog box, and the command parameter is to open an "import bookmark" panel.
In yet another implementation, the browser extension interface 101 is further configured to send a second invocation request to the browser kernel layer, where the second invocation request includes an invocation command and a command parameter, and the second invocation request is an invocation request associated with the browser kernel layer;
the browser kernel layer 102 is further configured to parse the command parameter, execute the call command using the command parameter, and send a call result to the browser extension interface.
According to the calling device of the browser extension interface, when an extension interface calling command is executed by the browser control layer, the browser kernel layer does not process the calling request, only forwards the calling request and the calling result, so that the kernel does not need to be recompiled by the browser kernel layer, the development efficiency is improved, and the browser control layer executes the calling command, so that the calling command depends on the control version and does not depend on the kernel version; and before using the second interface to call the command, whether the current control layer supports the call command can be checked through the first interface in advance, so that failure caused by calling attempt is avoided.
Based on the description of the method embodiment and the device embodiment, the embodiment of the application also provides a terminal. Referring to fig. 10, the terminal includes at least a processor 201, an input device 202, an output device 203, and a computer storage medium 204. Wherein the processor 201, input device 202, output device 203, and computer storage medium 204 within the terminal may be connected by a bus or other means.
A computer storage medium 204 may be stored in the memory of the terminal, said computer storage medium 204 being adapted to store a computer program comprising program instructions, said processor 201 being adapted to execute said program instructions stored by said computer storage medium 204. The processor 201 (or central processing unit, CPU)) is a computing core and a control core of the terminal, and is adapted to implement one or more instructions, and specifically, adapted to load and execute the one or more instructions so as to implement a corresponding method flow or a corresponding function.
An embodiment of the present application further provides a computer storage medium (memory), which is a memory device in the terminal and is used for storing programs and data. It is understood that the computer storage medium herein may include a built-in storage medium in the terminal, and may also include an extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores an operating system of the terminal. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 201. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by processor 201 to perform the corresponding steps of the method in the calling embodiment described above with respect to the browser extension interface. In particular implementations, one or more instructions in the computer storage medium are loaded by processor 201 and perform the following steps:
controlling a browser extension interface to send a first calling request to a browser kernel layer, wherein the first calling request comprises a calling command and a command parameter;
controlling the browser kernel layer to forward the first calling request to a browser control layer;
controlling the browser control layer to analyze the command parameters, executing the calling command by using the command parameters, and sending the calling result to the browser kernel layer;
and controlling the browser kernel layer to forward the calling result to the browser extension interface.
In one implementation, the processor 201 is further configured to perform the following steps:
and controlling the browser extension interface to send a checking instruction to the browser kernel layer through the first interface, wherein the checking instruction is used for indicating whether the browser control layer supports the execution of the call command by using the command parameter.
In yet another implementation, the processor 201 executes the step of sending the first call request to the browser kernel layer by the browser extension interface, including:
and if the browser control layer supports the execution of the call command by using the command parameter, controlling the browser expansion interface to send the call command to the browser kernel layer through a second interface.
In yet another implementation, the first call request received by the browser kernel layer includes a callback function; the step of controlling, by the processor 201, the browser kernel layer to forward the first invocation request to the browser control layer includes:
controlling the browser kernel layer to forward the first call request to the browser control layer through inter-process communication, wherein the forwarded first call request further comprises a first identifier, and the first identifier is associated with the callback function;
the step of the processor 201 controlling the browser control layer to send the call result to the browser kernel layer includes:
and controlling the browser control layer to send the calling result to the browser kernel layer through interprocess communication, wherein the calling result also comprises the first identifier.
In yet another implementation, the first invocation request is an invocation request associated with the browser control layer.
In yet another implementation, the call command is to open a dialog box, and the command parameter is to open an "import bookmark" panel.
In yet another implementation, the processor 201 is further configured to perform the steps of:
controlling the browser extension interface to send a second calling request to the browser kernel layer, wherein the second calling request comprises a calling command and a command parameter, and the second calling request is a calling request associated with the browser kernel layer;
and controlling the browser kernel layer to analyze the command parameters, executing the calling command by using the command parameters, and sending a calling result to the browser extension interface.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. A calling method of a browser extension interface is characterized by comprising the following steps:
the method comprises the steps that a browser extension interface sends a first calling request to a browser kernel layer, wherein the first calling request comprises a calling command and command parameters;
the browser kernel layer forwards the first calling request to a browser control layer;
the browser control layer analyzes the command parameters, executes the calling command by using the command parameters, and sends the calling result to the browser kernel layer;
and the browser kernel layer forwards the calling result to the browser extension interface.
2. The method of claim 1, further comprising:
and the browser extension interface sends a checking instruction to the browser kernel layer through a first interface, wherein the checking instruction is used for indicating whether the browser control layer supports the execution of the call command by using the command parameter.
3. The method of claim 2, wherein the browser extension interface sends a first invocation request to the browser kernel layer, comprising:
and if the browser control layer supports the use of the command parameter to execute the call command, the browser expansion interface sends the call command to the browser kernel layer through a second interface.
4. The method according to any one of claims 1 to 3, wherein the first call request received by the browser kernel layer comprises a callback function; the browser kernel layer forwards the first call request to a browser control layer, and the method comprises the following steps:
the browser kernel layer forwards the first calling request to a browser control layer through inter-process communication, wherein the forwarded first calling request further comprises a first identifier, and the first identifier is associated with the callback function;
the browser control layer sends the calling result to the browser kernel layer, and the calling result comprises the following steps:
and the browser control layer sends the calling result to the browser kernel layer through interprocess communication, wherein the calling result also comprises the first identifier.
5. The method of claim 1, wherein the first invocation request is an invocation request associated with the browser control layer.
6. The method of claim 1, wherein the call command is to open a dialog box, and wherein the command parameter is to open an "import bookmark" panel.
7. The method of claim 1, further comprising:
the browser extension interface sends a second calling request to the browser kernel layer, wherein the second calling request comprises a calling command and a command parameter, and the second calling request is a calling request associated with the browser kernel layer;
and the browser kernel layer analyzes the command parameters, executes the calling command by using the command parameters, and sends a calling result to the browser extension interface.
8. A calling apparatus for a browser extension interface, comprising: the browser comprises a browser expansion interface, a browser kernel layer and a browser control layer;
the browser extension interface is used for sending a first calling request to the browser kernel layer, wherein the first calling request comprises a calling command and command parameters;
the browser kernel layer is used for forwarding the first calling request to the browser control layer;
the browser control layer is used for analyzing the command parameters, executing the calling command by using the command parameters and sending the calling result to the browser kernel layer;
and the browser kernel layer is also used for forwarding the calling result to the browser expansion interface.
9. A terminal comprising an input device and an output device, further comprising:
a processor adapted to implement one or more instructions; and the number of the first and second groups,
memory storing one or more instructions adapted to be loaded by the processor and to perform a method of invoking a browser extension interface according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon one or more instructions adapted to be loaded by a processor and to execute the method of invoking the browser extension interface of any of claims 1-7.
CN201911321780.9A 2019-12-17 2019-12-17 Calling method and device of browser extension interface, terminal and storage medium Pending CN112988410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911321780.9A CN112988410A (en) 2019-12-17 2019-12-17 Calling method and device of browser extension interface, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911321780.9A CN112988410A (en) 2019-12-17 2019-12-17 Calling method and device of browser extension interface, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN112988410A true CN112988410A (en) 2021-06-18

Family

ID=76344136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911321780.9A Pending CN112988410A (en) 2019-12-17 2019-12-17 Calling method and device of browser extension interface, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112988410A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176834A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Method and device for calling expansion interface
US20130339842A1 (en) * 2011-02-28 2013-12-19 Beining Qihoo Technology Company Limited Browser-engine mode switching method and browser
CN103777938A (en) * 2012-10-25 2014-05-07 百度在线网络技术(北京)有限公司 Playing method and device supporting multiple browsers
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108572834A (en) * 2018-04-16 2018-09-25 腾讯科技(深圳)有限公司 A kind of upgrade method and device of browser
CN110109718A (en) * 2019-03-26 2019-08-09 阿里巴巴集团控股有限公司 A kind of application programming interfaces call method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130339842A1 (en) * 2011-02-28 2013-12-19 Beining Qihoo Technology Company Limited Browser-engine mode switching method and browser
CN103176834A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Method and device for calling expansion interface
CN103777938A (en) * 2012-10-25 2014-05-07 百度在线网络技术(北京)有限公司 Playing method and device supporting multiple browsers
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108572834A (en) * 2018-04-16 2018-09-25 腾讯科技(深圳)有限公司 A kind of upgrade method and device of browser
CN110109718A (en) * 2019-03-26 2019-08-09 阿里巴巴集团控股有限公司 A kind of application programming interfaces call method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
胡琳琳;郭志川;: "基于动态查找的嵌入式浏览器扩展接口的方法", 网络新媒体技术, no. 03, 15 May 2016 (2016-05-15) *

Similar Documents

Publication Publication Date Title
US10956191B2 (en) Systems and methods for customizing and programming a cloud-based management server
TW201640342A (en) Application page quick access method and mobile terminal using the same
CN106843953B (en) iOS system based application program transverse switching system and method
JP2005505047A5 (en)
WO2012119139A2 (en) Application compatibility with library operating systems
CN102929747A (en) Method for treating crash dump of Linux operation system based on loongson server
KR102546645B1 (en) Application startup method and appaturas, device and storage medium
CN112148699A (en) Log management method, device, equipment and medium
CN112181423A (en) Project construction method and device based on configuration file, computer equipment and medium
US8468388B2 (en) Restoring programs after operating system failure
US11379201B2 (en) Wrapping method, registration method, device, and rendering apparatus
CN113608742A (en) Detection method, code packet processing method, operation control method and computing device
CN112988410A (en) Calling method and device of browser extension interface, terminal and storage medium
CN111930455A (en) Page updating method, device, terminal and storage medium
JP2006276939A (en) Program starting method for virtual machine, and client server system
CN109597952B (en) Webpage information processing method, system, electronic equipment and storage medium
CN109977331B (en) Method and device for controlling execution of page resources
CN109947420B (en) Method for realizing shortcut key mechanism of code editor and electronic equipment
CN113722011B (en) Application interface starting method, device, equipment and storage medium
CN113282363A (en) Method and device for optimizing hybrid APP
KR101420026B1 (en) A method, apparatus and computer program for loading files during a boot-up process
US20040216140A1 (en) Method and system for accessing system operations through an interface layer
CN112579156A (en) Processing system, processing method, processing device and processing equipment of business event
CN112269739A (en) Webpage testing method and device, equipment and medium thereof
CN110673801A (en) Method and related device for initializing operation of dependent object

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221114

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518000

Applicant after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Applicant before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.