A browser extension program dynamic implementation method, system, terminal and medium

By creating basic extensions and proxy programs in the browser, using WEBSOCKET communication, and dynamically updating the configuration and function files of the browser extension, the problem of complex maintenance of traditional browser extensions is solved, and simplified update and customization functions are achieved.

CN117093285BActive Publication Date: 2025-09-23SHENZHEN YLINK COMPUTING SYST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311135470.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-09-23
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

The maintenance and update process of traditional browser extensions is complicated and cumbersome, making it difficult to adapt to frequently changing needs.

Method used

By creating a basic extension program in the local browser, using WEBSOCKET to communicate with the agent program, dynamically reading and updating configuration files and function extension files, dynamic maintenance and updating of browser extension functions can be achieved.

Benefits of technology

The maintenance and update process of browser extensions has been simplified. Users can achieve customization needs by modifying, adding or deleting configuration and function extension files without having to reinstall the browser extension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117093285B_ABST
    Figure CN117093285B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, terminal, and medium for dynamically implementing browser extensions. The method comprises: creating a base extension in a local browser; when the browser initiates a website access request, the base extension obtains a local configuration file; when the base extension detects that the configuration file contains a configuration corresponding to the website access request, the base extension obtains a local function extension file corresponding to the configuration and returns the function extension file to the browser; and the browser appends the function extension file to the access page returned by the website access request for execution. In this method, users can maintain and update the browser extension by modifying, adding, or deleting the configuration file and function extension file, eliminating the need to reinstall and load a new browser extension, thereby simplifying the browser extension maintenance and update process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of software technology, and in particular relates to a method, system, terminal and medium for dynamically implementing a browser extension program. Background Art

[0002] Browser extensions can run in the browser to provide additional functions and services. Browser extensions are mainly used to enhance the functionality of the browser and improve its usability. For example, browser extensions can provide functions such as auto-filling forms and automatic login for websites. For traditional browser extension implementation methods, see Figure 1 , loading various browser extensions in the browser. When the requirements of browser extensions change frequently and the number of functional points continues to increase, the traditional method requires constant updating of browser extensions, and the maintenance and update process is complicated and tedious. Summary of the Invention

[0003] In view of the deficiencies in the prior art, the present invention provides a method, system, terminal and medium for dynamically implementing a browser extension program, which simplifies the maintenance and update process of the browser extension program.

[0004] In a first aspect, a method for dynamically implementing a browser extension program includes:

[0005] Create a basic extension in your local browser;

[0006] When the browser initiates a request to access a website, the basic extension obtains the local browser configuration file for accessing the website;

[0007] When the basic extension program detects that the configuration file contains the configuration corresponding to the website access request, it obtains the local function extension file corresponding to the configuration and returns the function extension file to the browser;

[0008] The browser obtains the function extension file and appends the function extension file to the access page returned by the website access request for execution.

[0009] Furthermore, before the basic extension program obtains the local configuration file, it also includes:

[0010] Create a proxy program locally, which is used to store the configuration files of each browser accessing the website and the corresponding function extension files of each configuration.

[0011] Furthermore, the basic extension program communicates with the agent program through WEBSOCKET to read the configuration file and function extension file in the agent program.

[0012] Furthermore, it also includes:

[0013] When a new extension requirement is received, the corresponding configuration files and function extension files are modified, added, or deleted in the agent program.

[0014] Furthermore, it also includes:

[0015] Create an extended background service program; the extended background service program is used to communicate with the agent program and synchronize the configuration files and function extension files in the agent program.

[0016] Furthermore, the extended background service program is also used to implement extended functions when called by the agent program.

[0017] Furthermore, it also includes:

[0018] When the browser initiates a local resource operation or an extended background service request, the basic extension program sends the local resource operation or extended background service request to the proxy program through WEBSOCKET;

[0019] The agent program operates on local resources or calls the extended background service program to implement extended functions according to local resource operations or extended background service requests, and returns the results to the basic extension program;

[0020] The base extension returns the results to the browser.

[0021] Furthermore, the function extension file includes a JS file.

[0022] In a second aspect, a system for dynamically implementing a browser extension includes:

[0023] Browser: set locally; the browser is used to call the basic extension program when initiating a website access request; the browser is also used to obtain the function extension file returned by the basic extension program, and append the function extension file to the access page returned by the website access request for execution;

[0024] A basic extension program is created in the browser; when called, the basic extension program generates a configuration acquisition request based on a website access request and initiates the configuration acquisition request to the agent program; the basic extension program is further configured to initiate a function file acquisition request to the agent program when detecting that a configuration file contains a configuration corresponding to the website access request; the basic extension program is further configured to return the function extension file returned by the agent program to the browser;

[0025] Proxy program: set up locally, used to store configuration files for each browser to access the website and the function extension files of each configuration; the proxy program is used to read the corresponding configuration file according to the received configuration acquisition request and return the configuration file to the basic extension program; the proxy program is also used to read the corresponding function extension file according to the function file acquisition request and return the function extension file to the basic extension program.

[0026] Furthermore, it also includes:

[0027] Extended background service program: used to implement extended functions when called by the agent program;

[0028] The browser is also used to call the basic extension when initiating local resource operations or extension background service requests;

[0029] The basic extension is also used to send local resource operations or extended background service requests to the agent when called; the basic extension is also used to return the results returned by the agent to the browser;

[0030] The proxy program is also used to implement operations on local resources or call extended background service programs to implement extended functions based on local resource operations or extended background service requests, and return the results to the basic extension program.

[0031] In a third aspect, a terminal includes a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.

[0032] In a fourth aspect, a computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the method according to the first aspect.

[0033] As can be seen from the above technical solution, the method, system, terminal, and medium for dynamically implementing browser extensions provided by the present invention create a base extension program. The browser base extension dynamically reads a local function extension file based on the browser's configuration file. The browser obtains the function extension file content and appends the function extension file content to the accessed page for execution, thereby implementing the browser's extended functionality and meeting user customization needs. Users can maintain and update the browser extension program by modifying, adding, and deleting configuration files and function extension files, eliminating the need to reinstall and load a new browser extension program, thereby simplifying the maintenance and update process of the browser extension program. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly describes the drawings required for the specific embodiments or the description of the prior art. Similar elements or parts are generally identified by similar reference numerals throughout the drawings. Elements or parts in the drawings are not necessarily drawn to scale.

[0035] Figure 1 This is a schematic diagram of a traditional browser extension implementation method provided in the background technology.

[0036] Figure 2 A schematic diagram of a method for dynamically implementing a browser extension program provided in an embodiment.

[0037] Figure 3 An architectural diagram of a method for dynamically implementing a browser extension program provided in an embodiment.

[0038] Figure 4 A flowchart of a method for dynamically implementing a browser extension program provided in an embodiment.

[0039] Figure 5 This is a schematic diagram of accessing a page in an application provided in an embodiment.

[0040] Figure 6 This is a schematic diagram of appending execution results to an access page in an application provided in an embodiment. DETAILED DESCRIPTION

[0041] The following embodiments of the technical solution of the present invention are described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention and are therefore only examples and are not intended to limit the scope of protection of the present invention. It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.

[0042] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0043] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0044] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0045] Example:

[0046] A method for dynamically implementing browser extensions, see Figure 2 、 3 ,include:

[0047] Create a basic extension in your local browser;

[0048] When the browser initiates a request to access a website, the basic extension obtains the local browser configuration file for accessing the website;

[0049] When the basic extension program detects that the configuration file contains the configuration corresponding to the website access request, it obtains the local function extension file corresponding to the configuration and returns the function extension file to the browser;

[0050] The browser obtains the function extension file and appends the function extension file to the access page returned by the website access request for execution.

[0051] In this embodiment, the method can create a base extension program in a local browser and a proxy program locally. The proxy program stores configuration files for each browser and the function extension files for each configuration. The base extension program can be created based on the browser's specific needs or implemented using the browser's built-in plugin. The native system used by this method includes the browser, the base extension program, and a website backend service. The website backend service is used to return a specific access page based on a website access request. The extended service system used by this method includes the proxy program and the extended backend service program. When browser A needs to access website A, it can initiate a website access request containing the URL of website A and simultaneously call the base extension program. The base extension program reads the configuration file corresponding to browser A in the proxy program. The configuration file can include configuration settings for various extension requirements of each website. The configuration file can include common configurations for all projects as well as specific configurations for each project. For example, the common configuration may include: MAXOPPRJ = 30, indicating the maximum number of projects supported (default 15); MAXOPWND = 30, indicating the maximum number of task windows supported (default 15). For example, the special configuration may be: BASE_URL = http: / / www.testprj.com, function 1 URL; WAIT_URL = / TestApp / work / wait.html function 2 URL; PROC_URL = / TestApp / work / doWrk.html, indicating the job page URL.

[0052] In this embodiment, if the configuration file contains a configuration corresponding to a certain website, it means that the website has special extension requirements. At this time, the basic extension program needs to read the function extension file corresponding to the configuration. This method will set a corresponding function extension file for each configuration. When the configuration is modified, deleted, or added, the function extension file will also be modified, deleted, or added accordingly. The basic extension program returns the read function extension file to the browser. After the browser receives the function extension file, the function extension file is appended to the access page returned by the website access request for execution. The access page is the page returned to the browser by the visited website based on the website access request. The function extension file includes a JS (JavaScript) file.

[0053] This method for dynamically implementing browser extensions creates a base extension that dynamically reads a local extension file based on the browser's configuration file. The browser then appends the extension file to the access page returned by the website access request, thereby implementing the browser's extended functionality and meeting user customization requirements. Users can maintain and update the browser extension by modifying, adding, or deleting the configuration file and extension file, eliminating the need to reinstall or reload the browser extension, simplifying the maintenance and update process.

[0054] Furthermore, in some embodiments, the basic extension program communicates with the agent program via WEBSOCKET to read the configuration file and function extension file in the agent program.

[0055] In this embodiment, the browser cannot directly read local data, so a base extension is created in the browser. The base extension reads configuration files and function extension files from the proxy program via WEBSOCKET. The proxy program acts as a WEBSOCKET server, processing requests from the base extension. The base extension can save the read configuration files to the browser's local session storage object.

[0056] Furthermore, in some embodiments, the method further includes:

[0057] When a new extension requirement is received, the corresponding configuration files and function extension files are modified, added, or deleted in the agent program.

[0058] In this embodiment, when the browser extension requirement needs to be modified, added, or deleted, the method only needs to modify, add, or delete the corresponding configuration file and function extension file in the agent program.

[0059] Furthermore, in some embodiments, the method further includes:

[0060] Create an extended background service program; the extended background service program is used to communicate with the agent program and synchronize the configuration files and function extension files in the agent program.

[0061] In this embodiment, the extended background service program can be created locally or in the cloud. The extended background service program can be used to synchronize the configuration files and function extension files in the agent program, and play a backup role.

[0062] Furthermore, in some embodiments,

[0063] The extended background service program is also used to implement extended functions when called by the agent program.

[0064] Also includes:

[0065] When the browser initiates a local resource operation or an extended background service request, the basic extension program sends the local resource operation or extended background service request to the proxy program through WEBSOCKET;

[0066] The agent program operates on local resources or calls the extended background service program to implement extended functions according to local resource operations or extended background service requests, and returns the results to the basic extension program;

[0067] The base extension returns the results to the browser.

[0068] In this embodiment, the method can also enable the browser to access or operate local resources, or call an extended background service program to implement specific extended functions. When the browser needs to access or operate local resources, or call an extended background service program, a local resource operation or extended background service request is initiated. The local resource operation is used to identify the data that the browser wants to access or operate, and the extended background service request is used to identify which extended function the browser wants to implement. The basic extension program sends the local resource operation or extended background service request to the agent program. After receiving the local resource operation or extended background service request, the agent program operates on the local resources or calls the extended background service program to implement the extended function, and returns the result to the basic extension program. Local data includes locally stored files, pictures, videos and other resources. The basic extension program returns the result to the browser, so that the browser can access or operate local resources, or specific extended functions.

[0069] See also Figure 4 , this method can first synchronize the configuration file and function extension file on the agent program to the extension background service program. When the browser starts to access the website, it initiates a website access request and calls the basic extension program. The basic extension program obtains and accesses the configuration file on the agent program. If the configuration file has the corresponding configuration for the website, it obtains the function extension file and returns it to the browser. The browser appends the function extension file to the access page for execution. If the configuration file does not have the corresponding configuration for the website, the browser directly displays the access page. When this method needs to execute a specific extended function (which cannot be implemented by the existing function extension file), the extended function request interface of the agent program can also be called through the basic extension program. The extended function request interface calls the extension background service program to implement the specific extended function, and returns the results to the browser in sequence.

[0070] The following is an application of the dynamic implementation method of the browser extension. The browser extension requirement is: when entering the access page, the OCR recognition results of the business data and image data are returned. The function extension file includes: business data saving function, image data saving function, and OCR recognition result acquisition function. The function extension file provides polling checks: check whether the native page has entered the access page, whether the contract number has changed, and whether the OCR recognition result is obtained. The function extension file can also create a recognition button on the access page, and when the recognition button is triggered, the business data and image data are obtained. The function extension file can also create a floating layer on the access page to display the OCR recognition results. The OCR recognition function is implemented by extending the background service program. For a schematic diagram of the access page, see Figure 5 For a diagram of appending OCR recognition results to the accessed page, see Figure 6 .

[0071] A browser dynamic expansion system, comprising:

[0072] Browser: Set locally; the browser is used to call the basic extension program when initiating a website access request; the browser is also used to obtain the function extension file returned by the basic extension program and append the function extension file to the access page returned by the website access request for execution;

[0073] Basic extension: Created in the browser; when called, the basic extension generates a configuration acquisition request based on the website access request and initiates the configuration acquisition request to the agent. The basic extension also initiates a function file acquisition request to the agent when it detects that the configuration file contains the configuration corresponding to the website access request. The basic extension also returns the function extension file returned by the agent to the browser.

[0074] Proxy program: It is set up locally and is used to store the configuration files of each browser and the function extension files of each configuration; the proxy program is used to read the corresponding configuration file according to the received configuration acquisition request and return the configuration file to the basic extension program; the proxy program is also used to read the corresponding function extension file according to the function file acquisition request and return the function extension file to the basic extension program.

[0075] Furthermore, in some embodiments, the method further includes:

[0076] Extended background service program: used to implement extended functions when called by the agent program;

[0077] The browser is also used to call the basic extension when initiating local resource operations or extension background service requests;

[0078] The basic extension is also used to send local resource operations or extended background service requests to the agent when called; the basic extension is also used to return the results returned by the agent to the browser;

[0079] The proxy program is also used to implement operations on local resources or call extended background service programs to implement extended functions based on local resource operations or extended background service requests, and return the results to the basic extension program.

[0080] The system provided in the embodiment of the present invention is briefly described. For matters not mentioned in the embodiment part, reference may be made to the corresponding content in the aforementioned embodiment.

[0081] A terminal includes a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions and execute the above method.

[0082] In specific implementations, the terminals described in the embodiments of the present invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch-sensitive surfaces (e.g., touch screen displays and / or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but rather a desktop computer with a touch-sensitive surface (e.g., touch screen displays and / or touch pads).

[0083] In the following discussion, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and / or joystick.

[0084] The terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disk burning application, a spreadsheet application, a game application, a phone application, a video conferencing application, an email application, an instant messaging application, a workout support application, a photo management application, a digital camera application, a digital video camera application, a web browsing application, a digital music player application, and / or a digital video player application.

[0085] Various applications that can be executed on the terminal can use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and / or changed between applications and / or within a corresponding application. In this way, the common physical architecture of the terminal (e.g., the touch-sensitive surface) can support a variety of applications with user interfaces that are intuitive and transparent to the user.

[0086] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0087] Input devices may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc. Output devices may include a display (LCD, etc.), a speaker, etc.

[0088] The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store information about the device type.

[0089] The terminal provided in the embodiment of the present invention is briefly described. For matters not mentioned in the embodiment part, reference may be made to the corresponding contents in the aforementioned embodiment.

[0090] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the above method.

[0091] The computer-readable storage medium may be an internal storage unit of the terminal described in any of the aforementioned embodiments, such as a hard disk or memory of the terminal. The computer-readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the terminal and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0092] The medium provided in the embodiments of the present invention is briefly described. For matters not mentioned in the embodiment part, reference may be made to the corresponding contents in the aforementioned embodiments.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and description of the present invention.

Claims

1. A method for dynamically implementing a browser extension program, characterized in that: include: Create a basic extension in your local browser; When the browser initiates a website access request, the basic extension program obtains a local configuration file; When the basic extension program detects that the configuration file contains the configuration corresponding to the website access request, it obtains the local function extension file corresponding to the configuration and returns the function extension file to the browser; the configuration file includes the common configuration of all projects and the special configuration of each project; The browser obtains the function extension file and appends the function extension file to the access page returned by the website access request for execution; Before the basic extension program obtains the local configuration file, it also includes: Creating a proxy program locally, the proxy program is used to store the configuration files for each browser to access the website and the function extension files of each configuration; When the browser initiates a local resource operation or an extended background service request, the basic extension program sends the local resource operation or extended background service request to the agent program via WEBSOCKET; The agent program implements the operation on the local resource or calls the extended background service to implement the extended function according to the local resource operation or extended background service request, and returns the result to the basic extension program; The basic extension program returns the result to the browser; Also includes: When a new expansion requirement is received, the corresponding configuration file and the function expansion file are modified, added or deleted in the agent program; Creating an extended background service program; the extended background service program is used to communicate with the agent program and synchronize the configuration file and the function extension file in the agent program; The extended background service program is created locally or in the cloud. The extended background service program is used to synchronize the configuration files and function extension files in the agent program and play a backup role.

2. The method for dynamically implementing a browser extension program according to claim 1, wherein: The basic extension program communicates with the agent program via WEBSOCKET, and reads the configuration file and the function extension file in the agent program.

3. The method for dynamically implementing a browser extension program according to claim 1, wherein: The extended background service program is also used to implement extended functions when called by the agent program.

4. A browser extension program dynamic implementation system, characterized in that: include: Browser: set locally; the browser is used to call the basic extension program when initiating a website access request; The browser is further configured to obtain a function extension file returned by the basic extension program, and append the function extension file to the access page returned by the website access request for execution; Basic extensions: created within the browser; The basic extension program is configured to, when called, generate a configuration acquisition request based on the website access request and initiate the configuration acquisition request to the agent program; the basic extension program is further configured to initiate a function file acquisition request to the agent program when detecting that the configuration file contains the configuration corresponding to the website access request; the basic extension program is further configured to return the function extension file returned by the agent program to the browser; Proxy program: set up locally, used to store configuration files for each browser to access the website and the function extension files of each configuration; the proxy program is used to read the corresponding configuration file according to the received configuration acquisition request and return the configuration file to the basic extension program; The agent program is further configured to read the corresponding function extension file according to the function file acquisition request, and return the function extension file to the basic extension program; When the browser initiates a local resource operation or an extended background service request, the basic extension program sends the local resource operation or extended background service request to the agent program via WEBSOCKET; The agent program implements the operation on the local resource or calls the extended background service to implement the extended function according to the local resource operation or extended background service request, and returns the result to the basic extension program; The basic extension program returns the result to the browser; When a new expansion requirement is received, the corresponding configuration file and the function expansion file are modified, added or deleted in the agent program; Creating an extended background service program; the extended background service program is used to communicate with the agent program and synchronize the configuration file and the function extension file in the agent program; The extended background service program is created locally or in the cloud. The extended background service program is used to synchronize the configuration files and function extension files in the agent program and play a backup role.

5. A terminal, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and device for achieving extended functions of browser

    CN103246660A

  • Method and device for loading service component to application program

    CN107526605A

  • Page extended function implementing method and device

    CN108334379A

  • Browser extension program distribution method and device, electronic equipment and storage medium

    CN115857969A