WO2014071771A1 - 扩展WebApp应用功能的方法和系统 - Google Patents

扩展WebApp应用功能的方法和系统 Download PDF

Info

Publication number
WO2014071771A1
WO2014071771A1 PCT/CN2013/083037 CN2013083037W WO2014071771A1 WO 2014071771 A1 WO2014071771 A1 WO 2014071771A1 CN 2013083037 W CN2013083037 W CN 2013083037W WO 2014071771 A1 WO2014071771 A1 WO 2014071771A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
webapp
extended
application
address
Prior art date
Application number
PCT/CN2013/083037
Other languages
English (en)
French (fr)
Inventor
梁捷
俞永福
何小鹏
朱顺炎
马妙魁
Original Assignee
广州市动景计算机科技有限公司
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 广州市动景计算机科技有限公司 filed Critical 广州市动景计算机科技有限公司
Priority to US14/440,859 priority Critical patent/US20150301873A1/en
Publication of WO2014071771A1 publication Critical patent/WO2014071771A1/zh

Links

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/541Interprogram communication via adapters, e.g. between incompatible applications
    • 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
    • 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/542Event management; Broadcasting; Multicasting; Notifications
    • 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/547Remote procedure calls [RPC]; Web services

Definitions

  • the present invention claims the priority of a Chinese patent application filed on November 7, 2012 by the Chinese Patent Office, Application No. 201210442145.8, entitled “Method and System for Expanding WebApp Application Functions", The entire contents are incorporated in the present invention by the use of the bow I. TECHNICAL FIELD
  • the present invention relates to the field of mobile communication technologies, and in particular, to a method and system for extending a WebApp (Web Application) application function. Background technique
  • WebApp is a web-based system and application. It is a browser-based web application built on the HTML (Hypertext Markup Language) 5 standard. Its role is to release a large number of end users. Group complex content and features.
  • HTML Hypertext Markup Language
  • Many browser vendors implement a WebApp framework on their browsers to install WebApps to extend the capabilities of the browser.
  • FIG. 1 shows a schematic diagram of the limitations of the browser on the WebApp.
  • a method for extending a WebApp application function including: Adding a function extension field in the WebApp that includes an extended JS function and an address of the local application that responds to the extended JS function request;
  • the WebApp framework sets the address of the local application to the address of the local application that responds to the extended JS function request based on the invocation message received by the browser kernel;
  • the activated target application executes the extended JS function according to the parameters of the extended JS function and returns the execution result to the WebApp.
  • a system for extending a WebApp application function comprising: a function extension field configuration unit, configured to add a Web application including an extended JS function and a local application in response to the extended JS function request Function extension field of the address;
  • An extended function calling unit configured to invoke the extended JS function, and send each parameter of the function to the browser kernel by using the call;
  • a local application locking unit configured to set an address of the target application to an address of the local application requested in response to the extended JS function according to an invocation message received by the browser kernel;
  • a local application activation unit configured to activate the target application specified by the address according to an address of the local application
  • the extended function execution unit is configured to execute the extended JS function according to the parameter of the extended JS function by the activated target application, and return the execution result to the WebApp.
  • a method of extending a WebApp application function in which a function extension field is added, the function extension field including an extended JS function name and an address of a target application that responds to the extended JS function request , the method includes:
  • the target application that sends the parameter of the extended JS function to the address of the target application includes:
  • the returning the running result to the WebApp includes:
  • the running result is fed back to the WebApp as the extended JS function return value through the WebApp framework.
  • the WebApp framework sends the parameters of the extended JS function to the target application indicated by the address by using an Intent;
  • the target application uses the Intent to return the running result to the WebApp framework.
  • the service executed by the target application is an interfaced service or an interfaceless service.
  • the function extension field is added in the configuration file of the WebApp installation package.
  • a system for extending a WebApp application function in which a function extension field is added, the function extension field including an extended JS function name and an address of a target application that responds to the extended JS function request , the system includes:
  • a sending unit configured to send, when the WebApp invokes the extended JS function, a parameter of the extended JS function to a target application pointed to by an address of the target application;
  • a program running unit configured to execute the target application according to the parameter of the extended JS function, and return the running result to the WebApp.
  • the sending unit includes:
  • a function calling subunit configured to send parameters of the extended JS function to a browser kernel by calling the extended JS function
  • a kernel running subunit configured to notify a WebApp framework of parameters of the extended JS function by using the browser kernel
  • a first frame running subunit configured to send, by the WebApp framework, parameters of the extended JS function to a target application indicated by the address.
  • the program running unit includes:
  • a program running subunit configured to return a running result to the WebApp framework by using the target application;
  • the second framework running a subunit configured to use the running result as the extension by using the WebApp framework
  • the JS function returns the value back to the WebApp.
  • a computer readable medium having program code executable by a processor, when executed, causes the processor to perform the following steps: Adding a function extension field in the WebApp, where the function extension field includes an extended JS function name and an address of the target application that responds to the extended JS function request;
  • the method and system for utilizing the WebApp application function according to the present invention described above enables the WebApp to directly use the functions of other applications installed on the operating system (as long as the corresponding application is already installed on the operating system), and invokes the provided in other applications.
  • the function greatly expands the capabilities of the WebApp, allowing the WebApp to use the functionality of other applications installed on the operating system other than the browser, without having to let the browser expand.
  • WebApp can be done with local applications, because it can access the applications that have implemented these functions according to the package name and use The features they provide. For example, for some new specifications specified by HTML 5: Battery API (Application Programming Interface), direction sensor, etc. If the browser does not provide such a function, then WebApp can still be implemented because it can use other installations. The local application with these functions gets the battery's power and current direction sensor data.
  • Battery API Application Programming Interface
  • FIG. 1 is a schematic diagram of restrictions on a WebApp by a browser in the prior art
  • FIG. 2 is a schematic flowchart of a method for extending a WebApp application function according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an application flow of a method for extending a WebApp application function according to an embodiment of the present invention
  • 4 is a block diagram showing a system for extending a WebApp application function according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for extending a WebApp application function according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a system for extending a WebApp application function according to an embodiment of the present invention.
  • Browser Kernel The part responsible for loading, displaying, and executing JS on the web, is the core of the browser. Among them, JS is short for Javascript.
  • WebApp A web application that is used to run on a browser.
  • WebApp Framework A browser module responsible for implementing WebApp installation, operation, uninstallation, and update.
  • target application used in the description of the specific embodiment of the present invention may be any program capable of networking applications such as a browser, a mobile phone QQ, etc., unless otherwise specified, in general, a user needs to perform networking.
  • the application can be considered as a web application as expressed in the present invention.
  • local application and “target application” have the same meaning.
  • the present invention adds a configuration item in the configuration file of the WebApp, which represents that the JS interface will be extended and the service of the local application is invoked by using the interface, so that the WebApp is enabled.
  • This field includes an extended JS (JavaScript) function name ("a string") and a response to the above JS extension.
  • the address of the application requested by the function wherein the address of the application requested in response to the above JS extension function may be the package name, class name, or system protocol of the local application.
  • the JS function name can forward the call to the application in the actual application process to implement the extension of the WebApp application function.
  • FIG. 2 is a flow chart showing a method of extending a WebApp application function according to an embodiment of the present invention. As shown in Figure 2, the specific process of extending the WebApp application function includes:
  • S210 Add, in the configuration file of the WebApp or otherwise, a function extension field including an extended JS function and an address of the local application in response to the extended JS function request, where the local request is "in response to the extended JS function request"
  • the application address can be the package name, class name, or system protocol of the local application. The process name and system protocol processing flow and package name processing flow are the same.
  • the local application package name (or class name, system protocol) is the address of the local application that responds to the extended JS function request, that is, the address of the target application to be extended.
  • the extended JS function can be extended in the configuration file, or other possible Means expansion.
  • S220 Send each parameter of the function to the browser kernel by calling the extended JS function;
  • the WebApp framework sets the address of the target application to the address of the local application requested by the extended JS function according to the call message received by the browser kernel (eg, responding to the above JS extension function request by the package name of the local application) The address of the application); the call message includes parameters filled in when the JS function is called, and which service is required to be executed by the target application in one call, and can be expressed by the parameter;
  • S240 activate the target application specified by the address according to the address of the local application
  • the activated target application executes the extended JS function according to the parameters of the extended JS function, and returns the execution result to the WebApp.
  • the parameter is determined by the business logic, and may or may not be required.
  • the target application which is a fraction representing the percentage of brightness, for example, 0.65, which means that the brightness is adjusted to 65%.
  • the key to extending the WebApp application function of the present invention is to add a field including the target application calling function to the configuration file of the WebApp installation package (this field can be regarded as an extension of the WebApp application function).
  • Application field the address of the target application is the package name (or class name, system protocol) of the calling function. In this way, you can extend the JS interface based on the existing WebApp application function by extending the application field and use this interface to call the service of the local application, making the WebApp Ability to use other applications already installed on the operating system.
  • the field name of the added function extension field is: " eX t_fim C ti 0n ", the value corresponding to this field is an array of strings, the array contains two values, and one is a registered extension.
  • the function name the other is the address string of the local application service that responds to the extension function call.
  • the registered extension function name can be used in the JavaScript (web script code) code of the WebApp.
  • the address string of the local application service is the address of the application requested in response to this JS extension function.
  • the package name is used as the address, because the package name can be used to locate an Activity or Service, etc.
  • the Activity or Service receives and processes the WebApp to send past requests through the browser.
  • the sending method can utilize the Intent technology provided by the Android platform.
  • the Activity and Service are one of the Android components, and the Activity provides the interface service. Provide a non-interface service.
  • the Activity or Service is processed, the results are returned to the WebApp, so the process of transferring a WebApp request from the browser to other applications on the operating system and returning the results is completed.
  • the JS function extended by the "ext_fim C tion" field is the same as other normal functions, and can be used as a normal function. When this extension function is called, the data that you want to pass to the local application is passed through the parameters of this function.
  • the implementation methods of other platforms are similar.
  • the difference between different platforms is only the transmission part of the message between applications, for example, the Android platform uses the Intent.
  • the IOS platform may use the UI (user interface) Document Interaction Controller.
  • This embodiment utilizes a new configuration item in the WebApp configuration file, which means that a JS interface will be extended and the local application service can be invoked by using this interface, so that the WebApp can use the functions of other applications already installed on the operating system.
  • the specific applications of the two phases of installation and operation are described in detail below.
  • the installation process of the WebApp when parsing the configuration file of the WebApp installation package, it checks whether there is a field that extends JS to the local application, for example, the field name is "ext_fimction". If there is this field, the field is obtained in this field. Corresponding value, and detect whether the value is a string data of length 2, and if so, obtain the two strings, one of which is the extended JS function name, and the other string is the package name of the local application. .
  • extension function name in the pre-configured "ext_fim C tion” field is just an extension function name, which is just a string, and the injected JS code is used to let the JS engine know the JS function name.
  • the JS function When the WebApp runs and calls this JS function, the JS function notifies the browser kernel of the call event and the parameters of the call.
  • the WebApp framework is assembled using the Intent provided by the Android system. That is, the address of the target application is set to the package name, and the parameters of the function call are filled in the Intent.
  • the Intent is similar to a messenger, and the target application can receive the Intent and read out the parameters.
  • Each platform that calls the target program has a different interface.
  • the Android platform uses the startActivity function.
  • the operating system starts or activates the Activity or Service specified by the package name according to the information of the Intent.
  • the application's Activity or Service takes the parameters of the Intent.
  • the method for extending the functionality of the WebApp application enables the WebApp to use the functions of other applications installed on the operating system other than the browser.
  • Example 1 The technical effects of the extended WebApp application function of the present invention will be described below in several specific application embodiments.
  • Example 1
  • the so-called local lexicon means downloading the dictionary to the local, so that the vocabulary can quickly find the words during use, save the time for the network to wait, and save the flow of searching for words in the cloud.
  • the local vocabulary will be very large, ranging from a few megabytes to several hundred megabytes.
  • the reader WebApp can directly use the local tangible dictionary, and the vocal dictionary quickly finds the meaning of the corresponding word by reading the local vocabulary and immediately returns it to the WebApp. Displayed by the WebApp. This process does not require traffic and does not require network waiting, greatly improving the user experience.
  • the general browser does not provide a JS interface to adjust the screen brightness to the WebApp.
  • the WebApp can call the function of an application that has been installed locally to adjust the brightness of the screen, so that the screen brightness is lowered.
  • the Geolocation function For some browsers that are not fully implemented in the HTML standard, if the Geolocation function is not implemented, all WebApps cannot obtain the current location information of the user. However, by using the method for extending the WebApp application function provided by the present invention, the information calculated by the application for locally acquiring the location information is fed back to the JS of the WebApp, and the WebApp can obtain the current location information of the user, and realize the same function of the Geolocation of the HTML 5 . .
  • the WebApp can make a call, send a text message, start an application, and the like.
  • a system 400 for extending a WebApp application function includes a function extension field configuration unit 410, an extension function invoking unit 420, and a local device.
  • the function extension field configuration unit 410 is configured to add a function extension field in the WebApp that includes an extended JS function and an address of the local application requested as a response extension JS function;
  • the extended function invoking unit 420 is configured to invoke the extended JS function, and send various parameters of the function to the browser kernel through the call;
  • the local application locking unit 430 is configured to set an address of the target application to an address of the local application requested in response to the extended JS function according to an invocation message received by the browser kernel;
  • the local application activation unit 440 is configured to activate the target application specified by the address according to the address of the local application;
  • the extended function execution unit 450 is configured to execute the extended JS function according to the parameters of the extended JS function by the activated target application, and return the execution result to the WebApp.
  • the function extension field configuration unit adds a function extension field in the configuration file of the WebApp; and, the function extension field configuration unit responds to the address of the local application requested by the extended JS function by using the local application package name, the class name or the system protocol.
  • the present invention further provides a method for extending a WebApp application function, in which a function extension field is added in a WebApp, and the function extension field includes an extended JS function name and a target application that responds to the extended JS function request. Address; the method also includes:
  • Step 501 Send the parameter of the extended JS function to the target application pointed to by the address of the target application when the WebApp invokes the extended JS function;
  • Step 502 Execute the target application according to the parameter of the extended JS function, and return the running result to the WebApp.
  • the target application to which the parameter of the extended JS function is sent to the address of the target application in step 501 may include:
  • the parameters of the extended JS function are sent to the target application indicated by the address by the WebApp framework.
  • the returning the running result to the WebApp in step 503 may include: returning the running result to the WebApp framework by using the target application;
  • the running result is fed back to the WebApp as the extended JS function return value through the WebApp framework.
  • the webApp framework may use an Intent to send parameters of the extended JS function to the target application indicated by the address;
  • the target application can use the Intent to return the running result to the WebApp framework.
  • the service executed by the target application may be an interfaced service or an interfaceless service.
  • the function extension field may be added in a configuration file of the WebApp.
  • the package name, class name or system protocol of the target application may be used as the address of the target application.
  • the present invention further provides a system for extending a WebApp application function, in which a function extension field is added in a WebApp, where the function extension field includes an extended JS function name and a target that responds to the extended JS function request.
  • the address of the application the system 600 also includes:
  • a sending unit 610 configured to send, when the WebApp invokes the extended JS function, a parameter of the extended JS function to a target application pointed to by an address of the target application;
  • the program running unit 620 is configured to execute the target application according to the parameter of the extended JS function, and return the running result to the WebApp.
  • the sending unit 610 may specifically include:
  • a function calling subunit configured to send parameters of the extended JS function to a browser kernel by calling the extended JS function
  • a kernel running subunit configured to notify a WebApp framework of parameters of the extended JS function by using the browser kernel
  • a first frame running subunit configured to send, by the WebApp framework, parameters of the extended JS function to a target application indicated by the address.
  • the program running unit 620 may specifically include:
  • a program running subunit configured to return a running result to the WebApp framework by using the target application;
  • the second framework running a subunit configured to use the running result as the extension by using the WebApp framework
  • the JS function returns the value back to the WebApp.
  • the present invention provides a computer readable medium having program code executable by a processor, which, when executed, causes the processor to perform the steps of: Adding a function extension field in the WebApp, where the function extension field includes an extended JS function name and an address of the target application that responds to the extended JS function request;

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种扩展WebApp应用功能的方法和系统,其中的方法包括:在WebApp中增加一个包含扩展JS函数和作为响应所述扩展JS函数请求的本地应用的地址的功能扩展字段;通过调用所述扩展JS函数把函数的各个参数发送至浏览器内核;WebApp框架根据浏览器内核接收的调用消息把本地应用程序的地址设置为响应所述扩展JS函数请求的本地应用的地址;根据所述本地应用的地址激活所述地址指定的目标应用程序;被激活的目标应用程序根据扩展JS函数的参数执行所述扩展JS函数,并把执行结果返回WebApp。该方法和系统能够让WebApp直接使用安装在操作系统上的其他应用的功能,扩展WebApp的能力。

Description

扩展 WebApp应用功能的方法和系统 本发明要求于 2012年 11月 7日提交中国专利局、 申请号为 201210442145.8、发 明名称为 "扩展 WebApp应用功能的方法和系统"的中国专利申请的优先权, 其全部 内容通过弓 I用结合在本发明中。 技术领域 本发明涉及移动通信技术领域,更为具体地,涉及一种扩展 WebApp (网络应用) 应用功能的方法和系统。 背景技术
WebApp是指基于 Web(网络)的系统和应用,是建立在 HTML(Hypertext Markup Language, 超文本标记语言) 5标准之上的基于浏览器的网络应用程序, 其作用是向 广大的最终用户发布一组复杂的内容和功能。 目前, 很多浏览器厂商都在浏览器上实 现了一套 WebApp框架, 用以安装 WebApp, 以实现扩展浏览器的功能。
然而, 由于 WebApp能够实现的功能均由 WebApp框架提供,而 WebApp框架能 够完成的功能, 又只能是由浏览器提供。 因此, 对于一些浏览器无法提供的功能, WebApp也就无法使用, 从而导致现有的 WebApp的功能相对有限, 这种情况大大限 制了 WebApp的发展空间。 图 1示出了浏览器对 WebApp的限制示意图。
然而, 现有的应用软件很多, 能完成的功能很多, 若把这些平台相关功能的实现 完全依赖于浏览器厂商去实现很不现实, 毕竟浏览器厂商一家之力无法一一实现, 而 且无法做得比原生应用还好, 甚至有可能引入大量的 BUG (漏洞)。
因此, 如何能让 WebApp直接使用安装在操作系统上的其他应用的功能,成为基 于浏览器的网络应用中亟需解决的问题。
发明内容
鉴于上述问题, 本发明的目的是提供一种扩展 WebApp应用功能的方法和系统, 以使得 WebApp能够直接使用安装在操作系统上的其他应用的功能。
根据本发明的一个方面, 提供了一种扩展 WebApp应用功能的方法, 包括: 在 WebApp中增加一个包含扩展 JS函数和作为响应所述扩展 JS函数请求的本地 应用的地址的功能扩展字段;
通过调用所述扩展 JS函数把函数的各个参数发送至浏览器内核;
WebApp 框架根据浏览器内核接收的调用消息把本地应用程序的地址设置为响 应所述扩展 JS函数请求的本地应用的地址;
根据所述本地应用的地址激活所述地址指定的目标应用程序;
被激活的目标应用程序根据扩展 JS函数的参数执行所述扩展 JS函数,并把执行 结果返回 WebApp。
根据本发明的另一方面, 提供了一种扩展 WebApp应用功能的系统, 包括: 功能扩展字段配置单元, 用于在 WebApp中增加一个包含扩展 JS函数和作为响 应所述扩展 JS函数请求的本地应用的地址的功能扩展字段;
扩展函数调用单元, 用于调用所述述扩展 JS函数, 并通过所述调用把函数的各 个参数发送至浏览器内核;
本地应用锁定单元,用于根据浏览器内核接收的调用消息把目标应用程序的地址 设置为响应所述扩展 JS函数请求的本地应用的地址;
本地应用激活单元, 用于根据本地应用的地址激活所述地址指定的目标应用程 序;
扩展函数执行单元, 用于通过被激活的目标应用程序根据扩展 JS函数的参数执 行所述扩展 JS函数, 并把执行结果返回 WebApp。
根据本发明的另一方面, 提供了一种扩展 WebApp应用功能的方法, 在 WebApp 中增加功能扩展字段,所述功能扩展字段包含扩展 JS函数名和响应所述扩展 JS函数 请求的目标应用程序的地址, 所述方法包括:
当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发送至所述目 标应用程序的地址指向的目标应用程序;
根据所述扩展 JS 函数的参数执行所述目标应用程序, 将运行结果返回所述
WebApp。
其中, 所述将所述扩展 JS函数的参数发送至所述目标应用程序的地址指向的目 标应用程序包括:
通过调用所述扩展 JS函数把所述扩展 JS函数的参数发送至浏览器内核; 通过所述浏览器内核将所述扩展 JS函数的参数通知 WebApp框架;
通过所述 WebApp框架将所述扩展 JS函数的参数发送至所述地址指示的目标应 用程序。
其中, 所述将运行结果返回所述 WebApp包括:
通过所述目标应用程序将运行结果返回 WebApp框架;
通过所述 WebApp 框架将所述运行结果作为所述扩展 JS 函数返回值反馈到 WebApp。
其中, 所述 WebApp框架利用 Intent将所述扩展 JS函数的参数发送至所述地址 指示的目标应用程序;
所述目标应用程序利用 Intent将所述运行结果返回 WebApp框架。
其中, 所述目标应用程序执行的服务为有界面的服务或无界面的服务。
其中, 所述功能扩展字段被增加在 WebApp安装包的配置文件中。
其中,以目标应用程序的包名、类名或者系统协议作为所述目标应用程序的地址。 根据本发明的另一方面, 提供了一种扩展 WebApp应用功能的系统, 在 WebApp 中增加功能扩展字段,所述功能扩展字段包含扩展 JS函数名和响应所述扩展 JS函数 请求的目标应用程序的地址, 所述系统包括:
发送单元,用于当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参 数发送至所述目标应用程序的地址指向的目标应用程序;
程序运行单元, 用于根据所述扩展 JS函数的参数执行所述目标应用程序, 将运 行结果返回所述 WebApp。
其中, 发送单元包括:
函数调用子单元,用于通过调用所述扩展 JS函数把所述扩展 JS函数的参数发送 至浏览器内核;
内核运行子单元, 用于通过所述浏览器内核将所述扩展 JS 函数的参数通知 WebApp框架;
第一框架运行子单元, 用于通过所述 WebApp框架将所述扩展 JS函数的参数发 送至所述地址指示的目标应用程序。
其中, 程序运行单元包括:
程序运行子单元, 用于通过所述目标应用程序将运行结果返回 WebApp框架; 第二框架运行子单元,用于通过所述 WebApp框架将所述运行结果作为所述扩展
JS函数返回值反馈到 WebApp。
根据本发明的另一方面,提供了一种具有处理器可执行的程序代码的计算机可读 介质, 在被执行时, 所述程序代码使得处理器执行下述步骤: 在 WebApp中增加功能扩展字段, 所述功能扩展字段包含扩展 JS函数名和响应 所述扩展 JS函数请求的目标应用程序的地址;
当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发送至所述目 标应用程序的地址指向的目标应用程序;
根据所述扩展 JS 函数的参数执行所述目标应用程序, 将运行结果返回所述
WebApp。
利用上述根据本发明的展 WebApp应用功能的方法和系统,能让 WebApp直接使 用安装在操作系统上的其他应用的功能(只要相应的应用在操作系统上已经安装了), 调用其他应用内提供的函数,大大扩展了 WebApp的能力,使得 WebApp能使用浏览 器以外其他安装在操作系统上的应用的功能, 而无须让浏览器去一一扩展。
上述使得 WebApp的能力大大扩展表现在:一些浏览器平台无法提供或者暂时未 提供的功能, WebApp利用本地的应用就可以做到, 因为它可以根据包名访问到已经 实现了这些功用的应用并使用它们提供的功能。例如,对于 HTML 5规定的一些新规 范: 电池 API (Application Programming Interface, 应用程序编程接口)、 方向传感器 等, 若浏览器还没提供这样的功能, 那么 WebApp还是可以实现, 因为它能使用其他 安装在本地的具有这些功能的应用获取到电池的电量和当前方向传感器的数据。
为了实现上述以及相关目的,本发明的一个或多个方面包括后面将详细说明并在 权利要求中特别指出的特征。下面的说明以及附图详细说明了本发明的某些示例性方 面。然而, 这些方面指示的仅仅是可使用本发明的原理的各种方式中的一些方式。此 夕卜, 本发明旨在包括所有这些方面以及它们的等同物。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现 有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。
通过参考以下结合附图的说明及权利要求书的内容,并且随着对本发明的更全面 理解, 本发明的其它目的及结果将更加明白及易于理解。 在附图中:
图 1为现有技术中浏览器对 WebApp的限制示意图;
图 2为根据本发明实施例的扩展 WebApp应用功能的方法流程示意图; 图 3为根据本发明实施例的扩展 WebApp应用功能的方法的应用流程示意图; 图 4为根据本发明实施例的扩展 WebApp应用功能的系统的方框示意图;
图 5为根据本发明实施例的扩展 WebApp应用功能的方法流程示意图; 图 6为根据本发明实施例的扩展 WebApp应用功能的系统结构示意图。
在所有附图中相同的标号指示相似或相应的特征或功能。 具体实施方式
为了使本技术领域的人员更好地理解本发明实施例中的技术方案,并使本发明实 施例的上述目的、特征和优点能够更加明显易懂, 下面结合附图对本发明实施例中技 术方案作进一步详细的说明。
在下面的描述中, 出于说明的目的, 为了提供对一个或多个实施例的全面理解, 阐述了许多具体细节。然而, 很明显, 也可以在没有这些具体细节的情况下实现这些 实施例。在其它例子中, 为了便于描述一个或多个实施例, 公知的结构和设备以方框 图的形式示出。
为了清楚地说明本发明的技术方案,以下先对描述本发明的过程中涉及的一些名 词作出解释。
浏览器内核: 负责对网页进行加载、 显示、 以及 JS的执行的部分, 是浏览器的 核心。 其中, JS是 Javascript的简称。
WebApp: 用来运行在浏览器上的网络应用程序。
WebApp框架: 负责实现 WebApp的安装, 运行, 卸载, 更新等功能的浏览器模 块。
另外, 本发明在对具体实施方式进行表述时所用到的 "目标应用程序"可以是浏 览器、手机 QQ等任何能够联网应用的程序, 如果没有特别的说明, 通常意义上的用 户进行联网所需要的应用程序都可以被视为本发明中所表述的网络应用程序。 另外, 为了理解上的方便, 在下面的表述中, "本地应用"和 "目标应用程序"表达的含义 相同。 为了解决 WebApp直接使用安装在操作系统上的其他应用的功能的问题,本发明 在 WebApp的配置文件中新增一个配置项, 代表将扩展一个 JS接口并利用此接口调 用本地应用的服务, 使得 WebApp能使用操作系统上已经安装的其他应用的功能。
要扩展 WebApp应用功能,使其不受 WebApp框架以及终端浏览器的制约而能够 使用操作系统上已经安装的其他应用的功能,首先需要在 WebApp安装包的配置文件 中增加一个字段, 该字段包括一个扩展 JS (JavaScript) 函数名 ("一个字符串") 和 一个响应上述 JS扩展函数请求的应用的地址, 其中, 响应上述 JS扩展函数请求的应 用的地址可以是本地应用的包名、 类名或者系统协议。 该 JS函数名能够在实际的应 用过程中把调用转发给应用程序, 以实现 WebApp应用功能的扩展。
图 2示出了根据本发明实施例的扩展 WebApp应用功能的方法流程示意图。如图 2所示, 具体的扩展 WebApp应用功能的流程包括:
S210: 在 WebApp的配置文件中或者以其他方式增加一个包含扩展 JS函数和作 为响应所述扩展 JS函数请求的本地应用的地址的功能扩展字段, 其中, 作为 "响应 所述扩展 JS函数请求的本地应用的地址" 的可以是本地应用的包名、 类名或者系统 协议, 用类名和系统协议处理流程和包名处理流程是一样的。
本地应用包名 (或者类名、 系统协议) 为响应扩展 JS函数请求的本地应用的地 址, 即要扩展的目标应用程序的地址, 扩展 JS函数可以在配置文件中扩展, 也可以 以其他可能的手段扩展。
S220: 通过调用上述扩展 JS函数把函数的各个参数发送至浏览器内核;
S230: WebApp框架根据浏览器内核接收的调用消息把目标应用程序的地址设置 为响应所述扩展 JS函数请求的本地应用的地址 (如: 以本地应用的包名表示的响应 上述 JS扩展函数请求的应用的地址); 该调用消息包括 JS函数调用时填写的参数, 一次调用需要目标应用程序执行哪种业务, 通过该参数就可以表示出来;
S240: 根据本地应用的地址激活所述地址指定的目标应用程序;
S250: 被激活的目标应用程序根据扩展 JS函数的参数执行所述扩展 JS函数, 并 把执行结果返回 WebApp。
其中, 在步骤 S220中, 参数由业务逻辑决定, 可以不需要参数, 也可能需要。 例如, 在一个调整屏幕亮度的程序中, 发给目标应用程序的参数就只需要一个, 为一 个代表亮度的百分比的小数, 例如 0.65, 代表把亮度调为 65%。 通过图 2 所示的流程可以看出, 本发明扩展 WebApp 应用功能的关键是在 WebApp安装包的配置文件中增加一个包括目标应用程序调用函数的字段(该字段可 以被视为 WebApp应用功能的扩展应用字段), 该目标应用程序的地址为调用函数的 包名 (或者类名、 系统协议)。 这样, 就可以通过扩展应用字段在已有的 WebApp应 用功能的基础上扩展一个 JS接口并利用此接口调用本地应用的服务, 使得 WebApp 能使用操作系统上已经安装的其他应用的功能。
具体地, 作为示例, 假设上述增加的功能扩展字段的字段名为: "eXt_fimCti0n", 与这个字段对应的值为一个字符串数组,数组包含有两个值,一个为注册的扩展函数 名, 另一个为响应扩展函数调用的本地应用服务的地址字符串。注册的扩展函数名可 以在 WebApp的 JavaScript (—种网页脚本代码) 代码中使用。 本地应用服务的地址 字符串为响应这个 JS扩展函数请求的应用的地址, 例如在 Android (安卓) 系统上, 使用包名作为地址, 因为利用包名可以定位到一个 Activity或 Service (服务)等, 由 这些 Activity或 Service接收并处理 WebApp通过浏览器发送过去的请求, 发送方法 可以利用 Android平台提供的 Intent (意图)技术,其中, Activity和 Service是 Android 组件之一, Activity提供有界面的服务, Service提供无界面的服务。 当 Activity 或 Service处理完毕, 将结果返回给 WebApp, 因此, 就完成了一个 WebApp的请求从浏 览器传送到操作系统上其他应用并返回运行结果的流程。 在 WebApp 内部中, 通过 "ext_fimCtion"字段扩展的 JS函数与其他普通函数是相同的, 可以将其当作一个普通 函数使用。当调用这个扩展函数时,想传给本地应用的数据通过这个函数的参数进行 传递。
以下以安卓平台为例对本发明的扩展 WebApp 应用功能的方法做更为详细地介 绍, 其他平台实现方法类似, 不同平台间的区别只在于消息在应用间的传递部分, 比 如 Android的平台使用了 Intent, IOS的平台则可能就要使用 UI (用户界面) Document Interaction Controller (文件关联控制器)。
本实施例利用在 WebApp的配置文件中新增一个配置项, 代表将扩展一个 JS接 口并利用此接口调用本地应用的服务,使得 WebApp能使用操作系统上已经安装的其 他应用的功能。 下面分别对安装和运行两个阶段的具体应用进行详细说明。
安装时:
WebApp在安装的过程中, 当解析 WebApp安装包的配置文件时, 会检查是否有 扩展 JS至本地应用的字段, 例如字段名为 "ext_fimction", 若有这个字段, 则在这个 字段中获取该字段对应的值, 并检测此值是否为一个长度为 2的字符串数据,若是的 话, 则获取这两个字符串, 其中一个字符串为扩展 JS函数名, 另外一个字符串为本 地应用的包名。
运行时的流程如图 3所示:
1 ) WebApp打开运行的过程中,检测此 WebApp的配置文件是否有" ext_fimction" 字段, 若有的话, 则先在这个 WebApp中注入一段 JS代码, 这段 JS代码的作用是在 JS的 window作用域下新增一个函数, 函数名为 "ext_fimction"字段指定的函数名, 并给这个自定义函数默认的实现: 被调用时把此函数的各个参数发送至浏览器内核。
其中, 虽然在配置文件中已经有预先配置好的 "ext_fimCtion"字段, 但 JS引擎 并不知道有, 因此要先在 WebApp 中注入, 以便让 JS 引擎知道。 预先配置的 "ext_fimCtion"字段中的扩展函数名只是一个扩展函数名字, 也就只是一个字符串而 已, 而注入的这段 JS代码的作用是让 JS引擎认识这个 JS函数名。
2) 当 WebApp运行并调用到这个 JS函数时, 这个 JS函数会把调用事件以及调 用时的参数通知浏览器内核。
3 ) 浏览器内核把这次调用消息通知 WebApp框架。
4) WebApp框架利用 Android系统提供的 Intent进行组装。 即把目标应用程序的 地址设为包名, 同时把函数调用时的参数填入 Intent。其中, Intent类似于一个信使, 目标应用程序能接收到该 Intent, 并把参数读出来。 调用目标程序各个平台都有不同 的接口, Android平台使用 startActivity函数。
5 ) 启动这个 Intent。
6) 操作系统根据 Intent的信息, 启动或者激活包名指定的 Activity或 Service。
7) 应用程序的 Activity或 Service取出 Intent中各个的参数。
8) 根据参数处理这个 Intent的请求, 执行 Intent请求的服务。
9) 函数执行结束后, 把结果设回给 Intent。
10) WebApp框架收到返回后的 Intent
11 ) 从 Intent中取出返回过来的运行结果。
12) 把运行结果作为 JS函数返回值反馈到 WebApp中。
通过上述实施例可以看出,本发明提供的扩展 WebApp应用功能的方法能够使得 WebApp能使用浏览器以外其他安装在操作系统上的应用的功能。这使得 WebApp的 能力大大增加, 具体表现在: 一些浏览器平台无法提供或者暂时未提供的功能, WebApp利用本地的应用就可以做到, 因为它可以根据包名访问到已经实现了这些功 用的应用并使用它们提供的功能。例如,对于 HTML 5规定的一些新规范: 电池 API、 方向传感器等, 若浏览器还没提供这样的功能, 那么 WebApp还是可以实现, 因为它 能使用其他安装在本地的具有这些功能的应用获取到电池的电量和当前方向传感器 的数据。
下面将以几个具体的应用实施例对本发明扩展 WebApp 应用功能的技术效果进 行说明。 实例一:
有道词典有两种方式的词库, 一种是云端词库, 一种是本地词库。所谓的本地词 库, 是指把词典下载到本地, 使得有道词典在使用过程中能快速到找到单词, 节省网 络等待的时间, 以及节省在云端查找单词的流量。 一般本地词库都会很大, 从几兆至 几百兆不等。
假设要实现一个英文阅读器的 WebApp, 该 WebApp能让用户在看英文文章的过 程中很方便的查找到某个单词对应的中文含义。然而, 按现有的做法, 只能是把用户 想要查找的单词发送至服务器, 等待服务器返回中文结果。然而, 在 GPRS环境或网 速较差的时候, 用户体验会很差, 因为每查一个单词都需要经过漫长的等待。
然而, 使用本发明提供的扩展 WebApp应用功能的方法,此阅读器 WebApp就能 够直接使用本地的有道词典,而有道词典通过读取本地词库快速找到对应单词的含义 并立即返回给 WebApp, 由 WebApp显示出来。此过程不需要流量,不需要网络等待, 大大提高了用户的体验。
实例二:
对于一些用 WebApp实现的阅读器,有时想增加一个调整屏幕亮度的功能。然而, 一般浏览器都不会提供调整屏幕亮度的 JS接口给 WebApp使用。 但是, 使用本发明 提供的扩展 WebApp应用功能的方法,可以让 WebApp调用本地已经安装的一个调整 屏幕亮度的应用的功能, 让屏幕亮度变低。
实例三:
对于一些对 HTML标准实现不够完善的浏览器, 若没实现 Geolocation (地理位 置)功能, 那所有的 WebApp均不能获取用户当前的位置信息。 然而, 使用本发明提 供的扩展 WebApp应用功能的方法,利用本地获取位置信息的应用计算出来的信息反 馈给 WebApp 的 JS, WebApp就能获取到用户当前的位置信息, 实现 HTML 5 的 Geolocation相同的功能。
实例四:
使用本发明提供的扩展 WebApp应用功能的方法, WebApp能打电话, 发短信, 启动一个应用等。
通过以上具体应用实施例, 可以看出, 使用本发明提供的扩展 WebApp应用功能 的方法, 能够让 WebApp具有跟原生的 App具有完全相同的功能。 与上述扩展 WebApp 应用功能的方法向对应, 本发明还提供一种扩展 WebApp 应用功能的系统。图 4示出了根据本发明实施例的扩展 WebApp应用功能的系统的方 框示意图, 如图 4所示,扩展 WebApp应用功能的系统 400包括功能扩展字段配置单 元 410、 扩展函数调用单元 420、 本地应用锁定单元 430、 本地应用激活单元 440和 扩展函数执行单元 450。
其中, 功能扩展字段配置单元 410用于在 WebApp中增加一个包含扩展 JS函数 和作为响应扩展 JS函数请求的本地应用的地址的功能扩展字段;
扩展函数调用单元 420用于调用所述述扩展 JS函数, 并通过所述调用把函数的 各个参数发送至浏览器内核;
本地应用锁定单元 430 用于根据浏览器内核接收的调用消息把目标应用程序的 地址设置为响应所述扩展 JS函数请求的本地应用的地址;
本地应用激活单元 440 用于根据本地应用的地址激活所述地址指定的目标应用 程序;
扩展函数执行单元 450用于通过被激活的目标应用程序根据扩展 JS函数的参数 执行所述扩展 JS函数, 并把执行结果返回 WebApp。
其中,功能扩展字段配置单元在 WebApp的配置文件中增加功能扩展字段;以及, 功能扩展字段配置单元以本地应用包名、 类名或者系统协议作为响应扩展 JS函数请 求的本地应用的地址。 参见图 5,本发明还提供一种扩展 WebApp应用功能的方法,该方法中,在 WebApp 中增加功能扩展字段,所述功能扩展字段包含扩展 JS函数名和响应所述扩展 JS函数 请求的目标应用程序的地址; 该方法还包括:
步骤 501 : 当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发 送至所述目标应用程序的地址指向的目标应用程序;
步骤 502: 根据所述扩展 JS函数的参数执行所述目标应用程序, 将运行结果返 回所述 WebApp。
其中, 步骤 501中所述将所述扩展 JS函数的参数发送至所述目标应用程序的地 址指向的目标应用程序可以包括:
通过调用所述扩展 JS函数把所述扩展 JS函数的参数发送至浏览器内核; 通过所述浏览器内核将所述扩展 JS函数的参数通知 WebApp框架;
通过所述 WebApp框架将所述扩展 JS函数的参数发送至所述地址指示的目标应 用程序。 其中, 步骤 503中所述将运行结果返回所述 WebApp可以包括: 通过所述目标应用程序将运行结果返回 WebApp框架;
通过所述 WebApp 框架将所述运行结果作为所述扩展 JS 函数返回值反馈到 WebApp。
其中, 所述 WebApp框架可以利用 Intent将所述扩展 JS函数的参数发送至所述 地址指示的目标应用程序;
所述目标应用程序可以利用 Intent将所述运行结果返回 WebApp框架。
其中, 所述目标应用程序执行的服务可以为有界面的服务或无界面的服务。 其中, 所述功能扩展字段可以被增加在 WebApp的配置文件中。
其中, 可以以目标应用程序的包名、类名或者系统协议作为所述目标应用程序的 地址。
参见图 6, 本发明还提供一种扩展 WebApp应用功能的系统, 在所述系统中, 在 WebApp中增加功能扩展字段, 所述功能扩展字段包含扩展 JS函数名和响应所述扩 展 JS函数请求的目标应用程序的地址, 该系统 600还包括:
发送单元 610, 用于当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数 的参数发送至所述目标应用程序的地址指向的目标应用程序;
程序运行单元 620, 用于根据所述扩展 JS函数的参数执行所述目标应用程序, 将运行结果返回所述 WebApp。
其中, 发送单元 610具体可以包括:
函数调用子单元,用于通过调用所述扩展 JS函数把所述扩展 JS函数的参数发送 至浏览器内核;
内核运行子单元, 用于通过所述浏览器内核将所述扩展 JS 函数的参数通知 WebApp框架;
第一框架运行子单元, 用于通过所述 WebApp框架将所述扩展 JS函数的参数发 送至所述地址指示的目标应用程序。
其中, 程序运行单元 620具体可以包括:
程序运行子单元, 用于通过所述目标应用程序将运行结果返回 WebApp框架; 第二框架运行子单元,用于通过所述 WebApp框架将所述运行结果作为所述扩展
JS函数返回值反馈到 WebApp。
另外,本发明还提供一种具有处理器可执行的程序代码的计算机可读介质,在被 执行时, 所述程序代码使得处理器执行下述步骤: 在 WebApp中增加功能扩展字段, 所述功能扩展字段包含扩展 JS函数名和响应 所述扩展 JS函数请求的目标应用程序的地址;
当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发送至所述目 标应用程序的地址指向的目标应用程序;
根据所述扩展 JS 函数的参数执行所述目标应用程序, 将运行结果返回所述
WebApp。
如上参照图 1〜图 6以示例的方式描述了根据本发明的扩展 WebApp应用功能的 方法和系统。但是, 本领域技术人员应当理解, 对于上述本发明所提出的本发明提供 的扩展 WebApp应用功能的方法和系统,还可以在不脱离本发明内容的基础上做出各 种改进。 因此, 本发明的保护范围应当由所附的权利要求书的内容确定。本领域的技 术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台 的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技 术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存 储介质中,如 ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可 以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例或者实施例的某 些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部 分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同之处。尤其, 对于 系统实施例而言, 由于其基本相似于方法实施例, 所以描述的比较简单, 相关之处参 见方法实施例的部分说明即可。
以上所述的本发明实施方式, 并不构成对本发明保护范围的限定。任何在本发明 的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明的保护范围之 内。

Claims

权 利 要 求
1、 一种扩展 WebApp应用功能的方法, 其特征在于, 包括:
在 WebApp中增加一个包含扩展 JS函数和作为响应所述扩展 JS函数请求的 本地应用的地址的功能扩展字段;
通过调用所述扩展 JS函数把函数的各个参数发送至浏览器内核;
WebApp框架根据浏览器内核接收的调用消息把本地应用程序的地址设置为 响应所述扩展 JS函数请求的本地应用的地址;
根据所述本地应用的地址激活所述地址指定的目标应用程序;
被激活的目标应用程序根据扩展 JS函数的参数执行所述扩展 JS函数, 并把 执行结果返回 WebApp。
2、 如权利要求 1所述的扩展 WebApp应用功能的方法, 其特征在于, 所述 目标应用程序提供的服务为有界面的服务或无界面的服务。
3、 如权利要求 1所述的扩展 WebApp应用功能的方法, 其特征在于, 所述 功能扩展字段被增加在 WebApp的配置文件中。
4、 如权利要求 1所述的扩展 WebApp应用功能的方法, 其特征在于, 所述 调用消息包括 JS函数调用时填写的参数, 所述参数表示一次调用需要目标应用 程序执行的业务。
5、 如权利要求 1所述的扩展 WebApp应用功能的方法, 其特征在于, 以本 地应用包名、 类名或者系统协议作为所述响应扩展 JS函数请求的本地应用的地 址。
6、 一种扩展 WebApp应用功能的系统, 其特征在于, 包括:
功能扩展字段配置单元, 用于在 WebApp中增加一个包含扩展 JS函数和作 为响应扩展 JS函数请求的本地应用的地址的功能扩展字段;
扩展函数调用单元, 用于调用所述扩展 JS函数, 并通过所述调用把函数的 各个参数发送至浏览器内核;
本地应用锁定单元,用于根据浏览器内核接收的调用消息把目标应用程序的 地址设置为响应所述扩展 JS函数请求的本地应用的地址;
本地应用激活单元,用于根据本地应用的地址激活所述地址指定的目标应用 程序;
扩展函数执行单元, 用于通过被激活的目标应用程序根据扩展 JS函数的参 数执行所述扩展 JS函数, 并把执行结果返回 WebApp。
7、 如权利要求 6所述的扩展 WebApp应用功能的系统, 其特征在于, 所述 功能扩展字段配置单元在 WebApp的配置文件中增加所述功能扩展字段。
8、 如权利要求 6所述的扩展 WebApp应用功能的系统, 其特征在于, 所述 功能扩展字段配置单元以本地应用包名、 类名或者系统协议作为所述响应扩展 JS函数请求的本地应用的地址。
9、 一种扩展 WebApp应用功能的方法, 其特征在于, 在 WebApp中增加功 能扩展字段,所述功能扩展字段包含扩展 JS函数名和响应所述扩展 JS函数请求 的目标应用程序的地址, 所述方法包括:
当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发送至所 述目标应用程序的地址指向的目标应用程序;
根据所述扩展 JS函数的参数执行所述目标应用程序, 将运行结果返回所述 WebApp。
10、 根据权利要求 9所述的方法, 其特征在于, 所述将所述扩展 JS函数的 参数发送至所述目标应用程序的地址指向的目标应用程序包括:
通过调用所述扩展 JS函数把所述扩展 JS函数的参数发送至浏览器内核; 通过所述浏览器内核将所述扩展 JS函数的参数通知 WebApp框架; 通过所述 WebApp框架将所述扩展 JS函数的参数发送至所述地址指示的目 标应用程序。
11、 根据权利要求 9或 10所述的方法, 其特征在于, 所述将运行结果返回 所述 WebApp包括:
通过所述目标应用程序将运行结果返回 WebApp框架;
通过所述 WebApp框架将所述运行结果作为所述扩展 JS函数返回值反馈到 WebApp。
12、 根据权利要求 10或 11所述的方法, 其特征在于, 所述 WebApp框架利 用 Intent将所述扩展 JS函数的参数发送至所述地址指示的目标应用程序;
所述目标应用程序利用 Intent将所述运行结果返回 WebApp框架。
13、 根据权利要求 9至 12任一项所述的方法, 其特征在于, 所述目标应用 程序执行的服务为有界面的服务或无界面的服务。
14、 根据权利要求 9至 13任一项所述的方法, 其特征在于, 所述功能扩展 字段被增加在 WebApp安装包的配置文件中。
15、 根据权利要求 9至 14任一项所述的方法, 其特征在于, 以目标应用程 序的包名、 类名或者系统协议作为所述目标应用程序的地址。
16、 一种扩展 WebApp应用功能的系统, 其特征在于, 在 WebApp中增加功 能扩展字段,所述功能扩展字段包含扩展 JS函数名和响应所述扩展 JS函数请求 的目标应用程序的地址, 所述系统包括:
发送单元,用于当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数 的参数发送至所述目标应用程序的地址指向的目标应用程序;
程序运行单元, 用于根据所述扩展 JS函数的参数执行所述目标应用程序, 将运行结果返回所述 WebApp。
17、 根据权利要求 16所述的系统, 其特征在于, 发送单元包括: 函数调用子单元,用于通过调用所述扩展 JS函数把所述扩展 JS函数的参数 发送至浏览器内核;
内核运行子单元, 用于通过所述浏览器内核将所述扩展 JS函数的参数通知 WebApp框架;
第一框架运行子单元, 用于通过所述 WebApp框架将所述扩展 JS函数的参 数发送至所述地址指示的目标应用程序。
18、 根据权利要求 16或 17所述的系统, 其特征在于, 程序运行单元包括: 程序运行子单元, 用于通过所述目标应用程序将运行结果返回 WebApp 框 架;
第二框架运行子单元,用于通过所述 WebApp框架将所述运行结果作为所述 扩展 JS函数返回值反馈到 WebApp。
19、 一种具有处理器可执行的程序代码的计算机可读介质, 在被执行时, 所 述程序代码使得处理器执行下述步骤:
在 WebApp中增加功能扩展字段, 所述功能扩展字段包含扩展 JS函数名和 响应所述扩展 JS函数请求的目标应用程序的地址;
当所述 WebApp调用所述扩展 JS函数时将所述扩展 JS函数的参数发送至所 述目标应用程序的地址指向的目标应用程序;
根据所述扩展 JS函数的参数执行所述目标应用程序, 将运行结果返回所述 WebApp。
PCT/CN2013/083037 2012-11-07 2013-09-06 扩展WebApp应用功能的方法和系统 WO2014071771A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/440,859 US20150301873A1 (en) 2012-11-07 2013-09-06 Method and system for expanding webapp application function

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210442145.8 2012-11-07
CN201210442145.8A CN102929638B (zh) 2012-11-07 2012-11-07 扩展WebApp应用功能的方法和系统

Publications (1)

Publication Number Publication Date
WO2014071771A1 true WO2014071771A1 (zh) 2014-05-15

Family

ID=47644450

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/083037 WO2014071771A1 (zh) 2012-11-07 2013-09-06 扩展WebApp应用功能的方法和系统

Country Status (3)

Country Link
US (1) US20150301873A1 (zh)
CN (1) CN102929638B (zh)
WO (1) WO2014071771A1 (zh)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929638B (zh) * 2012-11-07 2014-08-13 广州市动景计算机科技有限公司 扩展WebApp应用功能的方法和系统
CN104049980B (zh) * 2013-03-11 2017-09-29 联想(北京)有限公司 一种信息处理方法及装置
CN104102537B (zh) * 2013-04-07 2017-09-29 华为技术有限公司 一种应用调用方法及用户终端
CN104683297A (zh) * 2013-11-26 2015-06-03 中兴通讯股份有限公司 一种资源访问的方法及装置、服务器及终端
CN104808971B (zh) * 2014-01-24 2020-02-21 北京三星通信技术研究有限公司 网络应用程序管理器、方法、装置和移动终端
CN104932910A (zh) * 2014-03-20 2015-09-23 中国移动通信集团公司 应用程序接口扩展的方法及系统
US9727391B2 (en) 2014-07-08 2017-08-08 Able World International Limited Method for performing task on unified information units in a personal workspace
TWI625633B (zh) * 2014-07-03 2018-06-01 阿貝爾環球國際有限公司 網路上媒合需求的方法以及應用該方法的工作空間的交易平台
US9626157B2 (en) 2014-07-03 2017-04-18 Able World International Limited Method of projecting a workspace and system using the same
EP3166016A4 (en) * 2014-07-03 2017-05-10 Able World International Limited Combinatory working method for standardized elements in personal workspace, and computer program product and system using said method
US11360828B2 (en) 2014-07-08 2022-06-14 Able World International Limited Method for combining unified matters in personal workspace and system using the same
CN104267972B (zh) * 2014-10-20 2018-02-13 中国科学院声学研究所 浏览器本地接口扩展方法及装置
CN104699776A (zh) * 2015-03-10 2015-06-10 百度在线网络技术(北京)有限公司 网址导航实现方法及装置
CN105786511B (zh) * 2016-02-29 2019-05-07 四川长虹电器股份有限公司 终端设备Web应用管理的实现方法
CN106873961B (zh) * 2016-07-27 2021-09-28 创新先进技术有限公司 通过移动浏览器唤醒app应用的方法及装置
CN106897416A (zh) * 2017-02-22 2017-06-27 济南浪潮高新科技投资发展有限公司 一种交互方法、装置及系统
CN107092534A (zh) * 2017-04-22 2017-08-25 李虎 一种web站点调用本地程序的方法及装置
WO2018227899A1 (zh) 2017-06-14 2018-12-20 北京小米移动软件有限公司 应用交互方法、交互方法及装置
CN109086143B (zh) * 2017-06-14 2022-02-08 北京小米移动软件有限公司 应用交互方法及装置
CN110413259B (zh) * 2018-04-28 2022-07-29 中兴通讯股份有限公司 Android服务框架、实现扩展服务的方法及装置
CN110297675A (zh) * 2019-04-23 2019-10-01 五八有限公司 模块间相互调用的方法、装置、电子设备及存储介质
CN110737637B (zh) * 2019-09-26 2022-12-16 抖音视界有限公司 功能扩展方法、装置、电子设备及计算机可读存储介质
CN112527651A (zh) * 2020-12-16 2021-03-19 北京达佳互联信息技术有限公司 安装包大小的展示方法、装置、电子设备及存储介质
CN112769824B (zh) * 2021-01-07 2023-03-07 深圳市大富网络技术有限公司 一种信息传输状态更新方法、终端、装置及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008033483A2 (en) * 2006-09-15 2008-03-20 Emc Corporation Protecting client-side code
CN101488143A (zh) * 2008-01-16 2009-07-22 重庆安软信息科技有限公司 一种新型的web应用和本地应用的交互模式
CN102099798A (zh) * 2008-07-16 2011-06-15 谷歌公司 用于使用本机代码模块执行应用的方法和系统
CN102929638A (zh) * 2012-11-07 2013-02-13 广州市动景计算机科技有限公司 扩展WebApp应用功能的方法和系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001213B2 (en) * 2008-12-22 2011-08-16 Nokia Corporation Method, apparatus and computer program product for providing unrestricted content on a user terminal
WO2010130078A1 (zh) * 2009-05-11 2010-11-18 华为技术有限公司 一种widget通信方法及服务器
US8601363B2 (en) * 2009-07-20 2013-12-03 Facebook, Inc. Communicating information about a local machine to a browser application
US8266714B2 (en) * 2009-08-28 2012-09-11 Microsoft Corporation Access control in a multi-principal browser
US9390172B2 (en) * 2009-12-03 2016-07-12 Microsoft Technology Licensing, Llc Communication channel between web application and process outside browser
KR101653162B1 (ko) * 2010-10-13 2016-09-01 삼성전자주식회사 메시지 통신을 통해 위젯 확장 기능을 제공하는 모바일 통신 단말기 및 상기 모바일 통신 단말기의 동작 방법

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008033483A2 (en) * 2006-09-15 2008-03-20 Emc Corporation Protecting client-side code
CN101488143A (zh) * 2008-01-16 2009-07-22 重庆安软信息科技有限公司 一种新型的web应用和本地应用的交互模式
CN102099798A (zh) * 2008-07-16 2011-06-15 谷歌公司 用于使用本机代码模块执行应用的方法和系统
CN102929638A (zh) * 2012-11-07 2013-02-13 广州市动景计算机科技有限公司 扩展WebApp应用功能的方法和系统

Also Published As

Publication number Publication date
CN102929638A (zh) 2013-02-13
US20150301873A1 (en) 2015-10-22
CN102929638B (zh) 2014-08-13

Similar Documents

Publication Publication Date Title
WO2014071771A1 (zh) 扩展WebApp应用功能的方法和系统
US8650481B1 (en) Stable and secure use of content scripts in browser extensions
KR102159416B1 (ko) 하이브리드 모바일 애플리케이션을 구축하고 사용하는 시스템 및 방법
US9436482B2 (en) Input content to application via web browser
JP2019032883A (ja) ウェブアプリケーションを実施する方法、装置、サーバ、及びシステム
WO2023093429A1 (zh) 微应用的运行方法、装置、设备、存储介质及程序产品
WO2013159745A1 (zh) 网页浏览方法、WebApp框架、执行JavaScript方法及装置、移动终端
WO2013097592A1 (zh) 脚本加载技术
CN108416021B (zh) 一种浏览器网页内容处理方法、装置、电子设备及可读介质
WO2014063552A1 (zh) 一种下载应用的方法、终端、服务器及系统
CN109240697B (zh) 调用处理方法及装置、存储介质
WO2011066434A2 (en) Client-server input method editor architecture
US20180343174A1 (en) Rule based page processing and network request processing in browsers
WO2011088759A1 (zh) 嵌入式浏览器的实现方法、装置和数字电视接收终端
WO2013139268A1 (zh) 离线应用的生成及调用方法、终端及系统
CN109271213B (zh) Html5页面的加载方法、装置、计算机设备及存储介质
US20140039898A1 (en) Methods and apparatus for voiced-enabling a web application
CN104965723B (zh) 应用程序的运行方法及装置
EP2784672A1 (en) Method for processing information, browsing device and storage medium
US20180027355A1 (en) Data download method and apparatus
WO2017059727A1 (zh) 数据自适应显示方法、终端设备及服务器
WO2016100853A1 (en) Streamlined hosted applications
CN108287737B (zh) Service Worker启动方法、装置及电子设备
JP2009031960A (ja) クライアント装置およびサーバ装置の間の通信を中継する技術
KR101684454B1 (ko) 하이브리드 애플리케이션 및 이의 이벤트 처리 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13852947

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14440859

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13852947

Country of ref document: EP

Kind code of ref document: A1