CN107632884B - Method for starting external application program by browser through intermediate device - Google Patents

Method for starting external application program by browser through intermediate device Download PDF

Info

Publication number
CN107632884B
CN107632884B CN201710818094.7A CN201710818094A CN107632884B CN 107632884 B CN107632884 B CN 107632884B CN 201710818094 A CN201710818094 A CN 201710818094A CN 107632884 B CN107632884 B CN 107632884B
Authority
CN
China
Prior art keywords
browser
application program
external application
intermediate device
api
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710818094.7A
Other languages
Chinese (zh)
Other versions
CN107632884A (en
Inventor
陈超一
范渊
吴永越
郑学新
刘韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu DBAPPSecurity Co Ltd
Original Assignee
Chengdu DBAPPSecurity 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 Chengdu DBAPPSecurity Co Ltd filed Critical Chengdu DBAPPSecurity Co Ltd
Priority to CN201710818094.7A priority Critical patent/CN107632884B/en
Publication of CN107632884A publication Critical patent/CN107632884A/en
Application granted granted Critical
Publication of CN107632884B publication Critical patent/CN107632884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method for starting an external application program by a browser through an intermediate device, wherein the browser starts the external application program through the intermediate device; the intermediate device comprises a local Web Service interface and an API interface, and the intermediate device provides the API interface through the Web Service interface; the browser calls a Web Service interface provided by the intermediate device through an HTTP protocol, and the intermediate device starts an external application program by calling an API interface. The API interface comprises a first API interface and a second API interface; the intermediate device reads the complete path of the external application program through the first API interface, and the intermediate device starts the external application program through the second API interface. The invention expands the application function of the browser and has better application prospect.

Description

Method for starting external application program by browser through intermediate device
Technical Field
The invention belongs to the technical field of mobile communication, and particularly relates to a method for starting an external application program by a browser through an intermediate device.
Background
When a user displays a local application program in user equipment through a web browser, an external application program cannot be directly operated in a browser web page, because the browser does not have an interface for starting the application program; on the other hand, even if the external application program required by the user is installed locally on the user equipment, when the user needs to run the local external application program while browsing the website, the user cannot acquire the complete path of the application program. The external application is directed to the browser program, and other applications which interact with the browser besides the browser program can be referred to as external applications of the browser.
The reason why the browser cannot start the external application program is mainly two-way: on one hand, the browser and the webpage can not start the external application program because the browser has no complete path of the external application program; another aspect is because the browser does not have an API interface to launch the application. Due to security policies in a general browser, although an < input file = type > tag can select a certain file in a local computer and read data therein, a final webpage cannot read a complete path where the file is located through an interface provided by the browser, and cannot run the read data as an application program.
Disclosure of Invention
The invention aims to provide a method for starting an external application program by a browser through an intermediate device, wherein the browser acquires a complete path of the external application program and starts the external application program through the intermediate device; the intermediate device comprises a local Web Service interface and an API interface, and the intermediate device provides the API interface through the Web Service interface; the browser calls a Web Service interface provided by the intermediate device through an HTTP (hyper text transport protocol); the invention obtains the complete path of the external application program through the intermediate device and starts the external application program through the intermediate device.
The invention is mainly realized by the following technical scheme: a browser starts the method of the external application program through the intermediate device, the said browser obtains the complete route of the external application program and starts the external application program through the intermediate device; the intermediate device comprises a local Web Service interface and an API interface, and the intermediate device provides the API interface through the Web Service interface; the browser calls a Web Service interface provided by the intermediate device through an HTTP (hyper text transport protocol); the browser reads the complete path of the external application program by calling the API of the intermediate device, and the browser starts the external application program by calling the API of the intermediate device.
The API interfaces of the intermediate device comprise a first API interface and a second API interface; the browser reads the complete path of the external application program by calling a first API (application programming interface) of the intermediate device, and starts the external application program by calling a second API of the intermediate device.
The method for calling the Web Service interface provided by the intermediate device by the browser through the HTTP protocol is the prior art and is not an improvement point of the invention, so the method is not described in detail.
A method for starting an external application program by a browser through an intermediate device mainly comprises the following steps:
step S1, the Web application program running in the browser calls the Web Service interface provided by the intermediate device through the HTTP protocol;
step S2, the intermediate device pops up a file selection window through the first API interface, obtains the complete path of the external application program through the file selection window, and returns the complete path of the external application program as the return value of the first API interface to the Web application program in the browser for saving;
step S3, the Web application in the browser calls a second API interface using the previously saved complete path of the external application as a parameter, the second API interface calls an operating system API interface, the operating system API interface starts the external application, and the second API interface returns a result of starting the application to the Web application in the browser.
The intermediate device needs to be started manually or started automatically after being installed; when the browser calls the intermediate device, if the intermediate device is in the starting state, the operation is carried out according to the steps S1-S3; otherwise, a window for reminding the user to open the intermediate device pops up.
The step S2 mainly includes the following steps:
step S201, the browser calls a first API of the intermediate device, and if no response exists, a window for prompting a user to start the intermediate device is popped up; if the response is received, the intermediate device pops up a file selection window, the user selects a target file through the window, and the selected target file returns to the complete path of the external application program through the first API;
in step S202, the browser and the application running in the Web browser obtain the complete path of the external application, and the browser saves the complete path of the external application through the Web page.
The step S3 mainly includes the following steps:
step S301, a user selects an external application program to be started from the Web application programs in the browser, and the Web application program in the browser reads the complete path of the external application program saved in the step S2;
step S302, the Web application program in the browser calls a second API interface of the intermediate device by taking the complete path of the saved external application program as a parameter; if no response exists, popping up a window for prompting a user to start the intermediate device; if so, calling an API (application program interface) of an operating system by the second API, and running an external application program by the API of the operating system;
step S303, the second API interface returns the start result of the external application program to the Web application program in the browser according to the state returned by the operating system API interface.
In the using process of the invention, the browser saves the complete path of the external application program in the form of a webpage, the webpage uses the complete path of the external application program as a parameter to call the second API interface of the intermediate device, and the second API interface of the intermediate device calls the API interface of the operating system of the local computer to start the external application program, thereby realizing that the browser starts the external application program through the intermediate device.
In order to better implement the present invention, the operating system in step S3 is any one of a Windows system, a Linux system, and a macOS system.
In order to better implement the present invention, the browser is any one of a microsoft IE kernel-based browser, a google Chrome kernel-based browser, a Mozilla Gecko kernel-based browser, and an apple WebKit kernel-based browser. The browser is a general browser compatible with an HTTP protocol.
The intermediate device operates on a local computer independently of a browser and provides a local Web Service, and 2 main first API interfaces and second API interfaces are provided through the Web Service. The first API interface is used for reading a complete path of an external application program; the second API interface is used for starting an external application program.
The first API interface: the browser calls a first API (application program interface) to enable the intermediate device to pop up a local file selection window, and the local file selection window belongs to the intermediate device and is irrelevant to the browser; therefore, the intermediate device can acquire the complete path of the local file through the selected file in the window; the local file is an external application program, and after the complete path of the external program is acquired, the intermediate device returns the complete path of the external program to the browser and the webpage as a return value of the first API interface and stores the return value by the webpage; the first API interface may not pass in parameters.
The second API interface: the webpage in the browser calls a second API (application programming interface) of the intermediate device by taking the stored complete path of the external application program as a parameter; the second API interface calls an API interface of the operating system to run an external application program; after the external application program runs, according to the state returned by the API of the operating system, the intermediate device returns the result of success/failure of starting the application program to the webpage.
The invention has the beneficial effects that:
(1) the browser reads a complete path of an external application program through the intermediate device and starts the external application program through an API (application program interface) provided by the intermediate device;
(2) the first API interface is used for reading a complete path of an external application program, the browser can read the complete path of the external application program through the first API interface, and the browser stores the complete path of the external application program through a webpage;
(3) the second API interface is used for starting an external application program, and the second API interface calls the API interface of the operating system to run the external application program.
Drawings
FIG. 1 is a block diagram of a process for a browser to read a complete path of an external application;
fig. 2 is a block diagram of a process for starting an external application by a browser.
Detailed Description
Example 1:
in a general browser of the HTTP protocol, the intermediary device runs on the local computer independently of the browser; the browser acquires a complete path of an external application program through an intermediate device and starts the external application program; the intermediate device comprises a local Web Service interface and an API interface, and the intermediate device provides the API interface through the Web Service interface; the browser calls a Web Service interface provided by the intermediate device through an HTTP (hyper text transport protocol); the browser reads the complete path of the external application program by calling the API of the intermediate device, and the browser starts the external application program by calling the API of the intermediate device.
Due to the security policy in the general browser, although the < input file = type > tag can select a certain file in the local computer and read the data in the file, the final webpage cannot read the complete path of the file through the interface provided by the browser; when a user selects C: \ Windows \ System32\ mstsc.exe in a browser and then calls an [ input ]. value method in JavaScript, the browser only returns the file name 'mstsc.exe' string of the file selected by the user instead of returning the 'C: \ Windows \ System32\ mstsc.exe' string; therefore, a general browser cannot directly read the complete path of the external application and directly start the external application.
The Web application program running in the browser calls a Web Service interface provided by the intermediate device through an HTTP protocol, and the Web Service interface of the intermediate device is provided with an API (application program interface), so that the intermediate device can provide a complete path for reading the external application program and start the external application program for the browser, and the browser can start the external application program through the intermediate device.
Example 2:
the embodiment is further optimized on the basis of embodiment 1, and the API interface includes a first API interface and a second API interface.
The Web application program running in the browser calls a Web Service interface provided by an intermediate device through an HTTP protocol, the intermediate device starts a first API interface to read a complete path of an external application program local to the computer, and the browser can store the complete path of the external application program in the Web application program of the browser; the browser calls a second API interface provided by the intermediate device by taking the complete path as a parameter, and the second API interface calls an API of the operating system so as to start the external application program.
The invention obtains the complete path of the external application program through the intermediate device and starts the external application program through the intermediate device, thereby expanding the application function of the browser and having better application prospect.
The rest of this embodiment is the same as embodiment 1, and thus, the description thereof is omitted.
Example 3:
the present embodiment is further optimized on the basis of embodiment 2, as shown in fig. 1, a Web application of a browser calls a Web Service interface provided by an intermediate device through an HTTP protocol; the intermediate device reads a complete path of an external application program through a first API (application programming interface), and after the browser calls the first API of the intermediate device, if the intermediate device does not respond, a window for starting the intermediate device is popped out from the browser, and a user restarts the intermediate device; if the intermediate device responds, the intermediate device pops up a file selection window, a user selects a target file through the window, and a first API (application programming interface) of the intermediate device returns a complete path of an external application program; the Web application program of the browser obtains a complete path of an external application program and stores the complete path of the external application program in a webpage;
and the webpage in the browser calls a second API interface by taking the previously saved complete path of the external application program as a parameter, the second API interface calls an operating system API interface, the operating system API interface starts the external application program, and the second API interface returns the starting result of the application program to the webpage.
The invention obtains the complete path of the external application program through the intermediate device and starts the external application program through the intermediate device, thereby expanding the application function of the browser and having better application prospect.
Other parts of this embodiment are the same as embodiment 2, and thus are not described again.
Example 4:
the embodiment is further optimized on the basis of embodiment 2 or 3, the browser starts the external application program through the second API interface, as shown in fig. 2, a user may select a complete path of the saved external program in the browser, a web page in the browser calls the second API interface of the intermediate device with the complete path of the external program as a parameter, and if no response is made, a window requesting to start the intermediate device pops up in the browser; if so, calling an API interface of the operating system by a second API interface of the intermediate device to start an external application program; and the second API interface returns the result of the success/failure of the starting of the external program to the browser.
The invention obtains the complete path of the external application program through the intermediate device and starts the external application program through the intermediate device, thereby expanding the application function of the browser and having better application prospect.
The rest of this embodiment is the same as embodiment 2 or 3, and therefore, the description thereof is omitted.
Example 5:
in a general browser of the HTTP protocol, the intermediary device runs on the local computer independently of the browser; the browser reads a complete path of an external application program through an intermediate device and starts the external application program; the API interfaces of the intermediate device comprise a first API interface and a second API interface; the method for starting the external application program by the browser through the intermediate device mainly comprises the following steps:
step S1, the Web application program running in the browser calls the Web Service interface provided by the intermediate device through the HTTP protocol;
step S2, the intermediate device pops up a file selection window through the first API interface, obtains the complete path of the external application program through the file selection window, and returns the complete path of the external application program as the return value of the first API interface to the Web application program in the browser for saving;
step S3, the Web application in the browser calls a second API interface using the previously saved complete path of the external application as a parameter, the second API interface calls an operating system API interface, the operating system API interface starts the external application, and the second API interface returns a result of starting the application to the Web application in the browser.
The step S2 mainly includes the following steps:
step S201, the browser calls a first API of the intermediate device, and if no response exists, a window for prompting a user to start the intermediate device is popped up; if the response is received, the intermediate device pops up a file selection window, the user selects a target file through the window, and the selected target file returns to the complete path of the external application program through the first API;
in step S202, the Web application in the browser obtains the complete path of the external application, and the Web application in the browser saves the complete path of the external application.
The step S3 mainly includes the following steps:
step S301, a user selects an external application program to be started from the Web application programs in the browser, and the Web application program in the browser reads the complete path of the external application program saved in the step S2;
step S302, the Web application program in the browser calls a second API interface of the intermediate device by taking the complete path of the saved external application program as a parameter; if no response exists, popping up a window for prompting a user to start the intermediate device; if so, calling an API (application program interface) of an operating system by the second API, and running an external application program by the API of the operating system;
step S303, the second API interface returns the start result of the external application program to the Web application program in the browser according to the state returned by the operating system API interface.
The invention obtains the complete path of the external application program through the intermediate device and starts the external application program through the intermediate device, thereby expanding the application function of the browser and having better application prospect.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and all simple modifications and equivalent variations of the above embodiments according to the technical spirit of the present invention are included in the scope of the present invention.

Claims (5)

1. A method for starting an external application program by a browser through an intermediate device is characterized in that the browser acquires a complete path of the external application program through the intermediate device and starts the external application program; the intermediate device comprises a local Web Service interface and an API interface, and the intermediate device provides the API interface through the Web Service interface; the browser calls a Web Service interface provided by the intermediate device through an HTTP (hyper text transport protocol); the browser reads the complete path of the external application program by calling the API of the intermediate device, and starts the external application program by calling the API of the intermediate device;
the API interfaces of the intermediate device comprise a first API interface and a second API interface; the browser reads a complete path of an external application program by calling a first API (application programming interface) of the intermediate device, and starts the external application program by calling a second API of the intermediate device;
the method mainly comprises the following steps:
step S1, the Web application program running in the browser calls the Web Service interface provided by the intermediate device through the HTTP protocol;
step S2, the intermediate device pops up a file selection window through the first API interface, obtains the complete path of the external application program through the file selection window, and returns the complete path of the external application program as the return value of the first API interface to the Web application program in the browser for saving;
step S3, the Web application in the browser calls a second API interface using the previously saved complete path of the external application as a parameter, the second API interface calls an operating system API interface, the operating system API interface starts the external application, and the second API interface returns a result of starting the application to the Web application in the browser.
2. The method for starting external application program by browser through intermediary device according to claim 1, wherein said step S2 mainly comprises the following steps:
step S201, the browser calls a first API of the intermediate device, and if no response exists, a window for prompting a user to start the intermediate device is popped up; if the response is received, the intermediate device pops up a file selection window, the user selects a target file through the window, and the selected target file returns to the complete path of the external application program through the first API;
in step S202, the Web application in the browser obtains the complete path of the external application, and the Web application in the browser saves the complete path of the external application.
3. The method for starting external application program by browser through intermediary device according to claim 1, wherein said step S3 mainly comprises the following steps:
step S301, a user selects an external application program to be started from the Web application programs in the browser, and the Web application program in the browser reads the complete path of the external application program saved in the step S2;
step S302, the Web application program in the browser calls a second API interface of the intermediate device by taking the complete path of the saved external application program as a parameter; if no response exists, popping up a window for prompting a user to start the intermediate device; if so, calling an API (application program interface) of an operating system by the second API, and running an external application program by the API of the operating system;
step S303, the second API interface returns the start result of the external application program to the Web application program in the browser according to the state returned by the operating system API interface.
4. The method for starting an external application program by a browser through an intermediate device according to claim 1, wherein the operating system in step S3 is any one of a Windows system, a Linux system, and a macOS system.
5. The method for starting external application program by browser through intermediary device according to any of claims 1-4, wherein said browser is any one of Microsoft IE kernel based browser, Google Chrome kernel based browser, Mozilla Gecko kernel based browser, and apple WebKit kernel based browser.
CN201710818094.7A 2017-09-12 2017-09-12 Method for starting external application program by browser through intermediate device Active CN107632884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710818094.7A CN107632884B (en) 2017-09-12 2017-09-12 Method for starting external application program by browser through intermediate device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710818094.7A CN107632884B (en) 2017-09-12 2017-09-12 Method for starting external application program by browser through intermediate device

Publications (2)

Publication Number Publication Date
CN107632884A CN107632884A (en) 2018-01-26
CN107632884B true CN107632884B (en) 2021-06-01

Family

ID=61100904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710818094.7A Active CN107632884B (en) 2017-09-12 2017-09-12 Method for starting external application program by browser through intermediate device

Country Status (1)

Country Link
CN (1) CN107632884B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599486B1 (en) 2018-09-21 2020-03-24 Citrix Systems, Inc. Systems and methods for intercepting and enhancing SaaS application calls via embedded browser
CN109933445A (en) * 2019-03-14 2019-06-25 杭州汉领信息科技有限公司 It is not based on the local application call method of the browser-cross cross-system platform of plug-in unit

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541575B (en) * 2010-12-07 2017-04-05 腾讯科技(深圳)有限公司 Method and apparatus, the method for transmission splashette picture and server that browser is opened
CN103049320B (en) * 2012-12-17 2016-05-04 广州市动景计算机科技有限公司 In browser, start the method and apparatus of external application
CN103064738B (en) * 2013-01-15 2016-11-02 珠海金山办公软件有限公司 The method and system of local application forms embedding browser under Linux
CN103473367B (en) * 2013-09-27 2017-05-03 北京奇虎科技有限公司 Method for using local application program in browser and web browser
CN104239063B (en) * 2014-09-23 2018-08-10 福建星网视易信息系统有限公司 A kind of web browser and the method by web browser calling local application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
从浏览器快速启动程序;pretty;《电脑爱好者》;20011208;第63页 *

Also Published As

Publication number Publication date
CN107632884A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
US11921996B2 (en) Information processing terminal and control method
US10110604B2 (en) Sandbox technology based webpage browsing method and device
US9584612B2 (en) Systems and methods for pushing applications
US10699061B2 (en) Application page quick access
CN110020292B (en) Webpage content extraction method and terminal equipment
US10754917B2 (en) Method and system for displaying customized webpage on double webview
US10580051B2 (en) Background element associated with an application installed in a browser application
US10789308B2 (en) Method and apparatus for searching application and mobile terminal
US9372681B1 (en) Redirection of a document URL to a natively-operating application
JP2018531454A6 (en) Content integration in non-browser applications
JP2018531454A (en) Content integration in non-browser applications
CN108304234B (en) Page display method and device
US20170032494A1 (en) Methods for displaying a webpage fragment on a desktop and systems for taking a snapshot of webpage fragment for displaying on a desktop
WO2015158304A1 (en) Data processing method and apparatus
CN107632884B (en) Method for starting external application program by browser through intermediate device
CN105404458A (en) Webpage content updating method and apparatus
US8977954B2 (en) Method and system for providing HTML-based application capable of controlling web action and client
CN107800611A (en) The method and page layout switch device of a kind of page layout switch
CN108345683B (en) Webpage display method, device, terminal and storage medium
CN108287737B (en) Service Worker starting method and device and electronic equipment
US20150317143A1 (en) Method and apparatus for installing webpage application
EP2998885A1 (en) Method and device for information search
US20130332568A1 (en) Method of data processing by a navigation module
KR102506155B1 (en) Electronic device, application executing system and control methods thereof
CN113268277A (en) Web-based client access method and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant