Browser local interface extension method and device
A technology of local interface and extension method, which is applied in the field of browser local interface extension method and device, can solve problems such as single interface form, inability to expand complex interface, and inability to meet the requirements of JavaScript interface for web page development, so as to improve compatibility and reduce The effect of small workload
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0021] This embodiment takes the extended local interface chrome.webstore.install(string url, functionsuccessCallback, function failureCallback) (hereinafter referred to as chrome.webstore.install interface) as an example, which is used to download and install a certain web application in the Chrome application store . Among them, the parameter url indicates the download address of the web application installation package; the parameters successCallback and failureCallback are callback functions for download success or failure, the successCallback function is called when the web application download and installation is successful, and the failureCallback function is called when the web application download and installation fails .
[0022] figure 1 It is a schematic diagram of a browser local interface extension method provided by Embodiment 1 of the present invention. Such as figure 1 As shown, the system includes a JavaScript framework module and an Android registration i...
Embodiment 2
[0039] In this embodiment, the message transmitted between the JavaScript framework module and the Android system module is a character string, and the specific composition is as follows: message header, message type, callback function ID, separator, data type, data, terminator. The length and definition of each part can be freely agreed upon.
[0040] In this embodiment, the specific content of the message is as follows:
[0041] The message header is 7 bytes, which is "CWrtMsg";
[0042] The message type is 1 byte, where "S" stands for success and "F" stands for failure;
[0043] The ID of the callback function is variable in length and is the unique ID generated in the chromeInterface.js file;
[0044] The delimiter is 1 byte, which is "&";
[0045] The data type is 2 bytes, where "EI" represents a single application information, "EA" represents an application array information, "ID" represents a single application ID, "ST" represents a string, and "SA" represents a list o...
Embodiment 3
[0049] image 3 It is a schematic diagram of a browser local interface extension device provided by Embodiment 3 of the present invention. Such as image 3 As shown, the device includes: a JavaScript framework module 301 and an Android registration implementation module 302 .
[0050] The JavaScript framework module 301 is used for extending and encapsulating the browser local interface to obtain an extended interface;
[0051] Calling the implementation method of the JavaScript object, realizing the extension interface, and obtaining the extended JavaScript object;
[0052] The Android registration implementation module 302 is configured to register the JavaScript object extended in the JavaScript framework module to the browser kernel to realize the function of the JavaScript object.
[0053] The module of the browser local interface extension device in the third embodiment of the present invention can implement the browser local interface extension method in the first em...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


