CN113569180B - Universal browser expansion system - Google Patents

Universal browser expansion system Download PDF

Info

Publication number
CN113569180B
CN113569180B CN202110855251.8A CN202110855251A CN113569180B CN 113569180 B CN113569180 B CN 113569180B CN 202110855251 A CN202110855251 A CN 202110855251A CN 113569180 B CN113569180 B CN 113569180B
Authority
CN
China
Prior art keywords
browser
message
webpage
module
function
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
CN202110855251.8A
Other languages
Chinese (zh)
Other versions
CN113569180A (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.)
CETC 28 Research Institute
Original Assignee
CETC 28 Research Institute
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 CETC 28 Research Institute filed Critical CETC 28 Research Institute
Priority to CN202110855251.8A priority Critical patent/CN113569180B/en
Publication of CN113569180A publication Critical patent/CN113569180A/en
Application granted granted Critical
Publication of CN113569180B publication Critical patent/CN113569180B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a universal browser extension system. The expansion system shields the browser interface differences of Chrome, firefox, qixin and the like and provides a browser control function, a communication function among webpages, a communication function between webpages and clients and a single webpage opening function; the method can control the size, the position, the state and the like of the browser window, realize communication between browser webpages and between webpages and clients, avoid repeated opening of single-function pages, and provide support for comprehensive integration and application development of the information system. The invention adopts cross-platform JavaScript language development, can be used across different operating system platforms, can be written once and run everywhere, can run on Intel, loongson and Feiteng processors, is compatible with Windows, zhongzhiyin, galaxy and other operating systems, is suitable for Chrome, firefox, qiyanxin and other browsers, and has better expansibility and compatibility.

Description

Universal browser expansion system
Technical Field
The invention belongs to the field of information systems, and particularly relates to a universal browser extension system.
Background
At present, two methods exist in the webpage integration and application development of an information system, namely QEBView packaging browsers of Qt are used, and the problems of poor page compatibility, difficult debugging and large adaptation workload exist; another is to open a web page using a native browser, which has the following problems: the size, position and state of the browser cannot be controlled through software; the web pages are difficult to directly communicate with client software, and the information interaction generally needs to depend on third party services; a single web page is opened multiple times, and multiple situations of the same page appear in the browser.
Disclosure of Invention
The invention aims to expand the browser developed in JavaScript, shield the expansion difference of the browser such as Chrome, firefox, qixin and the like, control the size, the position and the state of the browser, and realize the function of bidirectional communication between webpages and clients and single-case opening of webpages. The method is suitable for comprehensive integration and application development of the information system, and particularly suitable for the field of webpage integration and application development in domestic software and hardware environments of command information systems.
The browser extension system is a browser extension programmed by adopting JavaScript language. The expansion system comprises an interface shielding module and a general function module. The interface shielding module performs compatible adaptation aiming at the difference of the native expansion interfaces of Chrome, firefox and Qixin browsers and provides a unified development interface for the universal functional module; the general function module is based on the interface shielding module, and is used for designing and realizing the functions of browser control, communication between webpages and clients, page single-case opening and the like.
The invention specifically provides a universal browser expansion system, which comprises a browser interface shielding module and a universal function module;
the browser interface shielding module is used for adapting to the differences of different browser expansion interfaces and providing a unified interface to the outside;
the general function module is used for providing basic functions of browser expansion.
The different browser includes: chrome browser, firefox browser, and QAnxin browser.
The browser interface shielding module is used for adapting to the difference of different browser expansion interfaces, and selecting different namespaces and interface modes by acquiring the type of the currently running browser, and comprises the following steps:
if the current browser is a Firefox browser, using a browser namespace and using a Promise mode interface;
if the current browser is a Chrome or an Qiman browser, a Chrome namespace is used, and a callback mode interface is used.
The general function module comprises a browser control module, an inter-webpage communication module, a client communication module and a webpage single-instance opening module;
the browser control module is used for realizing the control function of the browser;
the communication module between the webpages is used for realizing the information interaction function between the webpages;
the client communication module is used for realizing the communication function of the webpage and the client software;
the webpage single-instance opening module is used for realizing a single-instance opening function of the webpage.
The browser extension includes a content script and a background script in a technical architecture. The content script is a link of communication between the webpage and the background script and is responsible for transmitting the control instruction of the webpage to the background script; the background script is responsible for realizing the universal function module of the browser expansion. The functions provided by the general function modules follow specific requirements, including:
the webpage transmits the related control instruction to the content script;
the content script forwards the control instruction of the webpage and transmits the control instruction to the background script;
the background script carries out logic processing according to the corresponding control instruction, and invokes the interface shielding module interface to realize the function of browser expansion.
The control function of the browser comprises the following steps: browser size control, browser location control, and browser state control.
The information interaction function between the web pages comprises the following steps:
message communication inside a single webpage is realized through the communication module between webpages;
and realizing the message communication between the webpages through the communication module between the webpages.
The information interaction between the web pages follows specific requirements, including:
the message sender and the message receiver determine a message contract according to service requirements, wherein the message contract comprises a message theme and a message content, the message theme content is of a String type, and the message content is of a JSON type;
the message receiver subscribes to the message of the appointed message theme according to the message contract;
the message sender generates the message content in the JSON format according to the message contract and pushes the message content to the agreed message theme in the message contract;
and the message receiver analyzes the message content according to the message contract and carries out corresponding service logic processing.
The communication function between the webpage and the client software comprises the following steps:
the webpage can send messages to the client software through the client communication module;
the webpage can receive the information of the client software through the client communication module.
The web page and client software communication functions follow specific requirements, including:
the webpage and the client side communicate with each other in a WebSocket mode to realize two-way communication;
the message sender and the message receiver determine a message contract according to service requirements, wherein the message contract comprises a message theme and a message content, the message theme content is of a String type, and the message content is of a JSON type;
the message receiver subscribes to the message of the appointed message theme according to the message contract;
the message sender generates the message content in the JSON format according to the message contract and pushes the message content to the agreed message theme in the message contract;
and the message receiver analyzes the message content according to the message contract and carries out corresponding service logic processing.
The single-instance opening function of the webpage defines a mapping relation between a window and a page in expansion, and judges whether the page to be opened currently exists in the mapping relation or not when the page is opened, wherein the single-instance opening function comprises the following steps:
if the page to be opened is not in the mapping relation between the window and the page, calling an interface shielding layer interface to realize the opening of the page and maximize the top-mounted display, and newly adding the mapping relation between the window and the page in the mapping relation;
if the page to be opened is in the mapping relation of window and page, searching the corresponding window in the mapping relation through the page.
If the window does not maximize the top setting display, activating the window and realizing the maximized top setting display, otherwise, not intervening;
the browser size control includes: the height and width of the browser are controlled.
The browser location control includes: the lateral distance and the longitudinal distance of the browser from the upper left corner of the screen are controlled.
The browser state control includes: maximization, minimization, full screen and restore control of the browser.
The invention has the following remarkable advantages:
1) The interface difference of browser extensions such as Chrome, firefox, qiyan and the like is shielded, and support is provided for one-time writing and operation of the browser extensions.
2) The interface shielding module is separated from the general function module, and if other browsers need to be adapted, only related functions are added to the interface shielding module, so that the general function module is not affected.
3) The functions of directly controlling the size, the position and the state of the browser are supported, and a software developer can directly control the maximization, the minimization, the restoration, the full screen, the newly added window, the closed window, the newly added Tab, the Tab removal, the custom display and the like of the browser;
4) Supporting message subscription and release type communication among webpages, and solving the problem of difficult information interaction among webpages;
5) The web page and the client side are supported to communicate, the browser expansion establishes connection with the client side through the WebSocket, a secondary development interface is provided for the web page, the web page and the client side are communicated, dependence on third-party software is reduced, and the browser expansion is light and reliable;
6) And supporting single-case opening of the Web page, when the page function is opened for the first time, adding the Web page, and when the page is opened again, activating the opened page, thereby avoiding the situation that the page with the same function is repeatedly opened.
Drawings
The foregoing and other advantages of the invention will become more apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings and detailed description.
FIG. 1 is a architectural diagram of a browser extension;
FIG. 2 is a functional composition diagram of a browser extension;
FIG. 3 is an external relationship diagram of a browser extension;
FIG. 4 is a flow chart of interface mask module data processing;
FIG. 5 is a general functional data processing flow diagram;
FIG. 6 is a browser control function data processing diagram;
FIG. 7 is a flow chart of the process of communicating data between web pages;
FIG. 8 is a client communication data processing flow diagram;
FIG. 9 is a flow chart of page case opening data processing.
Detailed Description
The invention is further described with reference to the drawings and examples.
1. Function composition and use of browser extensions
As shown in FIG. 1, the invention provides a general browser extension system, which comprises an interface shielding module and a general function module in terms of functional composition. The functional composition is shown in fig. 2.
The interface shielding module performs compatible adaptation aiming at the difference of the native expansion interfaces of Chrome, firefox and Qixin browsers and provides a unified development interface for the universal functional module;
the general function module is based on the interface shielding module, and is used for designing and realizing the functions of browser control, communication between webpages and clients, page single-case opening and the like.
The browser interacts with the Web page and the client software externally, and the external interaction relationship is shown in fig. 3. The webpage realizes interaction with the browser extension by calling a secondary development interface of the browser extension; and the client and the browser are expanded to establish WebSocket connection to realize interaction. By means of browser expansion, the web page can realize bidirectional information interaction with client software.
2. Interface shield
1) Implementation principle
The differences in browser extension interfaces include namespace differences and interface form differences. In terms of namespaces, the namespaces used by the Firefox browser extension are browser, and the namespaces used by the Chrome and Qixin browser extension are Chrome; in terms of interface form, the Firefox browser expansion interface method is in a Promise form, and the Chrome and Qiyanxin browser expansion method is in a callback form. According to the difference, the interface shielding module shields Firefox, chrome and the naming space and interface form differences of the extended interface of the Qiyanxin browser, and provides an extended unified interface for the general functions. Based on the interface shielding module, the browser interface difference can be shielded, and support is provided for one-time writing and operation of browser expansion.
2) Data processing flow
The interface shielding module acquires the information of the currently running browser, and if the browser is a Firefox browser, a browser naming space is used, and a Promise mode interface is called; if the browser is a Chrome or an Qixin browser, calling a callback mode interface by using a Chrome naming space; if the three browsers are not the above, prompting that the browsers are not adapted. A specific data processing flow is shown in fig. 4.
3. General function
1) Implementation principle
The browser general function module functionally comprises a browser control module, a communication module between webpages, a client communication module and a webpage single-instance opening module; the technical architecture includes a content script and a background script. The content script can be communicated with the webpage and the background script, and is a link for communication between the webpage and the background script; the background script performs browser control, communication among webpages, client communication and corresponding logic processing of webpage single-instance opening by means of the transmitted webpage information of the content script, and invokes an interface of the interface shielding module to realize the general function of browser expansion.
2) General data processing flow
The general flow of data processing for the general functions of browser control, communication between web pages, client communication, and single-instance opening of web pages is shown in fig. 5. Firstly, a webpage transmits related operation instructions to a content script, the content script forwards the operation instructions to a background script, and the background script carries out logic processing according to the corresponding operation instructions and invokes an interface of an interface shielding module.
Information interaction modes among the webpage, the content script, the background script and the interface shielding module are shown in table 1.
TABLE 1
The steps of browser control, communication between webpages, client communication, webpage single-instance opening of a general function webpage transfer instruction to a content script and content script forwarding instruction to a background script are the same; the steps of the background script according to the instruction logic processing and the interface of the interface shielding layer called by the background script are different, and the background script according to the instruction logic processing and the interface of the interface shielding layer called by the background script are respectively introduced below.
3) Browser control flow
The background script realizes the browser control function according to different interfaces of the interface shielding layer of different modulation interfaces of the control instruction. As shown in fig. 6. The browser control interface is shown in table 2:
TABLE 2
4) Communication flow between webpages
The browser extension realizes message communication between webpages through a subscription and release mode, and the data processing flow is shown in fig. 7. Firstly, a message receiver and a message sender determine a message contract according to service requirements, and define the meaning of a message interaction theme and a message interaction content field according to the interaction of the clear message interaction content in a JSON format. The message receiver subscribes to the message of the specific theme according to the message contract, the message sender generates data in the JSON format according to the interface contract, the message theme is released, the message receiver receives the message content, and the message receiver analyzes and processes correspondingly according to the message contract.
5) Client communication flow
The browser extension establishes WebSocket connection with the client to realize bidirectional communication with the client, and the data processing flow is shown in fig. 8. When a webpage sends a message to a client, the webpage generates data in a JSON format according to a message contract and sends the message to the client; when receiving the client-side message, the browser expands and monitors the WebSocket message, analyzes the message according to the message contract after receiving the message, and pushes the analyzed message to the webpage of the message.
6) Page single case opening flow
And defining a mapping relation between a window and a page in the expansion, and judging whether the currently opened page is in the mapping relation or not when the page is opened. If the page record is not in the mapping relation, calling an interface shielding module interface, opening the page record in a new window, and adding a record in the mapping relation; if the page is in the mapping relation between the window and the page, searching the corresponding window through the page, if the window is not maximally displayed, calling an interface shielding module interface to activate the window and maximally display the window, and if the window is maximally displayed, returning. The specific flow is shown in fig. 9.
The present invention provides a general browser extension system, and the method and the way for implementing the technical scheme are numerous, the above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention. The components not explicitly described in this embodiment can be implemented by using the prior art.

Claims (1)

1. The universal browser expansion system is characterized by comprising a browser interface shielding module and a universal function module;
the browser interface shielding module is used for adapting to the differences of different browser expansion interfaces and providing a unified interface to the outside;
the general function module is used for providing basic functions of browser expansion;
the different browser includes: a Chrome browser, a Firefox browser, and an Qixin browser;
the browser interface shielding module is used for adapting to the difference of different browser expansion interfaces, and selecting different namespaces and interface modes by acquiring the type of the currently running browser, and comprises the following steps:
if the current browser is a Firefox browser, using a browser namespace and using a Promise mode interface;
if the current browser is a Chrome or an Qixin browser, using a Chrome name space and using a callback interface;
the general function module comprises a browser control module, an inter-webpage communication module, a client communication module and a webpage single-instance opening module;
the browser control module is used for realizing the control function of the browser;
the communication module between the webpages is used for realizing the information interaction function between the webpages;
the client communication module is used for realizing the communication function of the webpage and the client software;
the webpage single-instance opening module is used for realizing a single-instance opening function of the webpage;
the functions provided by the general function modules follow specific requirements, including:
the webpage transmits the related control instruction to the content script;
the content script forwards the control instruction of the webpage and transmits the control instruction to the background script;
the background script carries out logic processing according to the corresponding control instruction, and invokes an interface shielding module interface to realize the function of browser expansion;
the control function of the browser comprises the following steps: browser size control, browser position control and browser state control;
the information interaction function between the web pages comprises the following steps:
message communication inside a single webpage is realized through the communication module between webpages;
through the communication module among the webpages, the message communication between the webpages is realized;
the information interaction between the web pages follows specific requirements, including:
the message sender and the message receiver determine a message contract according to service requirements, wherein the message contract comprises a message theme and a message content, the message theme content is of a String type, and the message content is of a JSON type;
the message receiver subscribes to the message of the appointed message theme according to the message contract;
the message sender generates the message content in the JSON format according to the message contract and pushes the message content to the agreed message theme in the message contract;
the message receiver analyzes the message content according to the message contract and carries out corresponding service logic processing;
the communication function between the webpage and the client software comprises the following steps:
the webpage can send messages to the client software through the client communication module;
the webpage can receive the information of the client software through the client communication module;
the web page and client software communication functions follow specific requirements, including:
the webpage and the client side communicate with each other in a WebSocket mode to realize two-way communication;
the message sender and the message receiver determine a message contract according to service requirements, wherein the message contract comprises a message theme and a message content, the message theme content is of a String type, and the message content is of a JSON type;
the message receiver subscribes to the message of the appointed message theme according to the message contract;
the message sender generates the message content in the JSON format according to the message contract and pushes the message content to the agreed message theme in the message contract;
the message receiver analyzes the message content according to the message contract and carries out corresponding service logic processing;
the single-instance opening function of the webpage determines whether the page to be opened currently exists in the mapping relation or not by defining the mapping relation between the window and the page in the expansion, and comprises the following steps:
if the page to be opened is not in the mapping relation between the window and the page, calling an interface shielding layer interface to realize the opening of the page and maximize the top-mounted display, and adding the mapping relation between the window and the page in the mapping relation;
if the page to be opened is in the mapping relation between the window and the page, searching the corresponding window in the mapping relation through the page;
if the window does not maximize the top setting display, activating the window and realizing the maximized top setting display, otherwise, not intervening;
the browser size control includes: height and width control of the browser;
the browser location control includes: the horizontal distance and the longitudinal distance of the browser from the left upper corner of the screen are controlled;
the browser state control includes: maximization, minimization, full screen and restore control of the browser.
CN202110855251.8A 2021-07-28 2021-07-28 Universal browser expansion system Active CN113569180B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110855251.8A CN113569180B (en) 2021-07-28 2021-07-28 Universal browser expansion system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110855251.8A CN113569180B (en) 2021-07-28 2021-07-28 Universal browser expansion system

Publications (2)

Publication Number Publication Date
CN113569180A CN113569180A (en) 2021-10-29
CN113569180B true CN113569180B (en) 2024-01-26

Family

ID=78168425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110855251.8A Active CN113569180B (en) 2021-07-28 2021-07-28 Universal browser expansion system

Country Status (1)

Country Link
CN (1) CN113569180B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139276A (en) * 2011-12-05 2013-06-05 金蝶软件(中国)有限公司 Method and system of both-way communication between Web page and graphical user interface (GUI) client
CN104468698A (en) * 2014-10-11 2015-03-25 杭州盈高科技有限公司 Cross-browser webpage communication system and method
CN105357286A (en) * 2015-10-20 2016-02-24 中国电子科技集团公司第二十八研究所 Web-based real-time directional message pushing method
CN105407180A (en) * 2015-12-29 2016-03-16 曙光信息产业(北京)有限公司 Server message pushing method and device
CN105573733A (en) * 2014-10-16 2016-05-11 腾讯科技(深圳)有限公司 Communication method for browser and web front end and web front end and system
CN112416345A (en) * 2020-11-16 2021-02-26 中国电子科技集团公司第二十八研究所 Universal client software integration system
CN112486437A (en) * 2020-12-18 2021-03-12 武汉点石互动网络科技有限公司 Method for printing in Web application by cross-platform and cross-browser

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170279656A1 (en) * 2013-12-26 2017-09-28 Google Inc. Methods and systems of providing browser cross-page communication using ports

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139276A (en) * 2011-12-05 2013-06-05 金蝶软件(中国)有限公司 Method and system of both-way communication between Web page and graphical user interface (GUI) client
CN104468698A (en) * 2014-10-11 2015-03-25 杭州盈高科技有限公司 Cross-browser webpage communication system and method
CN105573733A (en) * 2014-10-16 2016-05-11 腾讯科技(深圳)有限公司 Communication method for browser and web front end and web front end and system
CN105357286A (en) * 2015-10-20 2016-02-24 中国电子科技集团公司第二十八研究所 Web-based real-time directional message pushing method
CN105407180A (en) * 2015-12-29 2016-03-16 曙光信息产业(北京)有限公司 Server message pushing method and device
CN112416345A (en) * 2020-11-16 2021-02-26 中国电子科技集团公司第二十八研究所 Universal client software integration system
CN112486437A (en) * 2020-12-18 2021-03-12 武汉点石互动网络科技有限公司 Method for printing in Web application by cross-platform and cross-browser

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Interactive Browser-Based Genomics Data Visualization Tools for Translational and Clinical Laboratory Applications;Thomas M. Pearce 等;《The Journal of Molecular Diagnostics》;985-993 *
基于eBase数据库的数据结构持久化研究与应用;李菡 等;《第二十三届中国数据库学术会议论文集(技术报告篇)》;429-432 *

Also Published As

Publication number Publication date
CN113569180A (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN103927163B (en) Plugin frame processing device and plugin system
CN103685269B (en) A kind of web browser carries out the method and system of both-way communication with server
US20150339175A1 (en) Method and device for starting external application program in browser
WO2009043035A4 (en) Network operating system
KR920016971A (en) Computer system and system and method for controlling graphical display therefor
CN111045878B (en) Cross-browser financial self-service terminal hardware calling method based on WebSocket
CN109032659B (en) Method for single-page application to reference remote page component based on configuration
CA2511916A1 (en) System and method of building wireless component applications
US20080059583A1 (en) Browser based web conferencing employing layering to display screen updates
CN108881395B (en) Message pushing method, device, message manager and computer readable storage medium
CN105763619A (en) Method and device for communication of client and server
CN113569180B (en) Universal browser expansion system
GB2542562A (en) Private access to HID
CN103177028A (en) Method and system for information interaction
CN114338722B (en) Cloud edge storage resource management system and method, storage medium and electronic equipment
CN103873452A (en) Method and system for connecting android system by PC (personal computer) browser
CN102364434A (en) Method for integrating Wine and Android mouse input
CN102662772A (en) Method for realizing data communication between different languages in multi-language development system
CN103067511B (en) A kind of control method of HTTP request process
CN102970325A (en) File upload method and system
US20120284630A1 (en) Window Proxy
CN104090792B (en) The dynamic loading method of logical file in a kind of broadband access network
CN105389096A (en) Browser based data interaction method and apparatus
CN115794095B (en) JavaScript-based illusion engine UI development method and system
CN103870280A (en) Webpage seamless combining processing method based on FLEX and JSP

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