[go: up one dir, main page]

CN107102877A - A kind of adaptive approach of browser-cross plug-in unit - Google Patents

A kind of adaptive approach of browser-cross plug-in unit Download PDF

Info

Publication number
CN107102877A
CN107102877A CN201710282674.9A CN201710282674A CN107102877A CN 107102877 A CN107102877 A CN 107102877A CN 201710282674 A CN201710282674 A CN 201710282674A CN 107102877 A CN107102877 A CN 107102877A
Authority
CN
China
Prior art keywords
browser
plug
standard
file
browser plug
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.)
Pending
Application number
CN201710282674.9A
Other languages
Chinese (zh)
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.)
SICHUAN ZHONGDIAN VENUS INFORMATION TECHNOLOGY Co Ltd
State Grid Information and Telecommunication Group Co Ltd
Information and Telecommunication Branch of State Grid Jibei Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Liaoning Electric Power Co Ltd
State Grid Corp of China SGCC
Original Assignee
SICHUAN ZHONGDIAN VENUS INFORMATION TECHNOLOGY Co Ltd
State Grid Information and Telecommunication Group Co Ltd
Information and Telecommunication Branch of State Grid Jibei Electric Power Co Ltd
Information and Telecommunication Branch of State Grid Liaoning Electric Power Co Ltd
State Grid Corp of China SGCC
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 SICHUAN ZHONGDIAN VENUS INFORMATION TECHNOLOGY Co Ltd, State Grid Information and Telecommunication Group Co Ltd, Information and Telecommunication Branch of State Grid Jibei Electric Power Co Ltd, Information and Telecommunication Branch of State Grid Liaoning Electric Power Co Ltd, State Grid Corp of China SGCC filed Critical SICHUAN ZHONGDIAN VENUS INFORMATION TECHNOLOGY Co Ltd
Priority to CN201710282674.9A priority Critical patent/CN107102877A/en
Publication of CN107102877A publication Critical patent/CN107102877A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种跨浏览器插件的自适应方法,包括标准浏览器插件,标准浏览器插件对浏览器读取网站的网页文件自适应,具体包括以下步骤:步骤1.1将所述标准浏览器插件载入当前浏览器;步骤1.2标准浏览器插件对当前浏览器内核进行访问并读取当前浏览器的信息;步骤1.3标准浏览器插件再对浏览器读取网站的网页文件进行解析,判断网页文件与当前浏览器是否兼容;步骤1.4标准浏览器插件再根据当前浏览器内核的类型对解析的网页文件进行一致性调整;步骤1.5浏览器将调整后的网页文件进行渲染显示,本发明通过标准浏览器插件对网页文件的解析以及一致性的调整,使得网页文件能够正常被渲染出来,有利于节约成本,不影响客户的操作。

The invention discloses a cross-browser plug-in self-adaptive method, which includes a standard browser plug-in, and the standard browser plug-in is self-adaptive to the browser to read the webpage files of the website, and specifically includes the following steps: step 1.1. The plug-in is loaded into the current browser; Step 1.2 The standard browser plug-in accesses the current browser kernel and reads the information of the current browser; Step 1.3 The standard browser plug-in then analyzes the web page file read by the browser to determine the web page Whether the file is compatible with the current browser; the step 1.4 standard browser plug-in is adjusted according to the type of the current browser kernel to the consistency of the parsed webpage file; the step 1.5 browser renders and displays the adjusted webpage file, and the present invention passes the standard The browser plug-in analyzes and adjusts the consistency of the webpage files, so that the webpage files can be rendered normally, which is conducive to saving costs and does not affect the customer's operation.

Description

一种跨浏览器插件的自适应方法An Adaptive Method for Cross-Browser Plug-ins

技术领域technical field

本发明涉及一种跨浏览器的插件,尤其涉及跨浏览器的标准插件,具体是指一种跨浏览器插件的自适应方法。The invention relates to a cross-browser plug-in, in particular to a cross-browser standard plug-in, in particular to a cross-browser plug-in adaptive method.

背景技术Background technique

浏览器是指可以显示网页服务器或者文件系统的HTML文件(标准通用标记语言的一个应用)内容,并让用户与这些文件交互的一种软件。为提高浏览器的扩展性和易用性,浏览器需要提供插件支持用户访问互联网上丰富的多媒体信息。A browser refers to a software that can display the content of an HTML file (an application of the standard universal markup language) on a web server or file system, and allows users to interact with these files. In order to improve the scalability and ease of use of the browser, the browser needs to provide plug-ins to support users to access rich multimedia information on the Internet.

浏览器内核分为Trident、Gecko、WebKit、Presto。Trident(又称为MSHTML)是微软开发的一种排版引擎,其代表产品为Internet Explorer,因此又称其为IE内核。Gecko是一套开放源代码的、以C++编写的网页排版引擎,Gecko内核代表作品Mozilla Firefox。WebKit是一个开源项目,包含了来自KDE项目和苹果公司的部分组件,它的特点在于源码结构清晰、渲染速度极快。缺点是对网页代码的兼容性不高,导致一些编写不标准的网页无法正常显示。主要代表作品有Safari和Google的浏览器Chrome。Presto是由Opera Software开发的浏览器排版引擎,支持随着DOM及Script语法的事件而对网页重新排版,主要代表作品为Opera。The browser kernel is divided into Trident, Gecko, WebKit, and Presto. Trident (also known as MSHTML) is a typesetting engine developed by Microsoft, and its representative product is Internet Explorer, so it is also called the IE core. Gecko is a set of open source web page typesetting engine written in C++. The representative work of Gecko kernel is Mozilla Firefox. WebKit is an open source project, including some components from the KDE project and Apple. It is characterized by a clear source code structure and extremely fast rendering speed. The disadvantage is that the compatibility with webpage codes is not high, which causes some non-standard webpages to not be displayed normally. The main representative works are Safari and Google's browser Chrome. Presto is a browser typesetting engine developed by Opera Software, which supports web page re-layout following DOM and Script syntax events. The main representative work is Opera.

浏览器插件技术主要用于扩充浏览器功能,主要有登记MIME类型,在浏览器串口中开设自己的工作窗口,接受和处理键盘、鼠标实践,使用URL从网络获取、传送数据,添加指向新的URL热键或热区,控制HTML页面等。由于浏览器内核的多样性,不同的内核支持不同标准的插件。Browser plug-in technology is mainly used to expand browser functions, including registering MIME types, opening its own working window in the browser serial port, accepting and processing keyboard and mouse practices, using URL to obtain and transmit data from the network, and adding pointers to new URL hotkeys or hotzones, control HTML pages, etc. Due to the diversity of browser kernels, different kernels support plug-ins of different standards.

因为插件由不同的发行商进行插件开发发行,其技术水平良莠不齐,插件程序很可能与其它运行中的程序发生冲突,从而导致诸如各种页面错误,运行时间错误等等现象,阻塞了正常浏览,且不同的浏览器开发标准不一致,导致浏览器插件仅能在特定浏览器中运行,对于不同的浏览器需要发布不同的插件,无法做到插件的统一,同时在浏览器读取网页文件时,当网页文件存在格式或者其他错误无法被当前浏览器正常识别最终无法正常显示。Because plug-ins are developed and released by different publishers, and their technical levels vary, plug-in programs are likely to conflict with other running programs, resulting in various page errors, runtime errors, etc., blocking normal browsing, Moreover, different browser development standards are inconsistent, resulting in browser plug-ins that can only run in specific browsers. Different plug-ins need to be released for different browsers, and plug-ins cannot be unified. At the same time, when a browser reads a web page file, When the webpage file has a format or other errors that cannot be properly recognized by the current browser, it will not be displayed normally.

发明内容Contents of the invention

本发明提供一种跨浏览器插件的自适应方法,用于解决现有技术中存在的:浏览器在读取网页文件时,当网页文件存在格式或者编写错误而导致浏览器在渲染时无法正常显示的问题,为了解决上述技术问题,达到在无需更换网页文件的情况下,对网页文件的错误进行修改并能够被当前浏览器正常显示的技术效果,本发明通过下述技术方案实现:一种跨浏览器插件框架的自适应方法,包括标准浏览器插件,标准浏览器插件对浏览器读取网站的网页文件自适应,具体包括以下步骤:The present invention provides a cross-browser plug-in self-adaptive method, which is used to solve the problem existing in the prior art: when the browser reads a webpage file, when the webpage file has a format or is wrongly written, the browser cannot render normally The problem of display, in order to solve the above-mentioned technical problems and achieve the technical effect of modifying the errors of the webpage file and being able to be displayed normally by the current browser without replacing the webpage file, the present invention is realized through the following technical solutions: a The adaptive method of the cross-browser plug-in framework includes a standard browser plug-in, and the standard browser plug-in adapts to the browser to read the web page file of the website, specifically including the following steps:

步骤1.1将所述标准浏览器插件载入当前浏览器;Step 1.1 loads the standard browser plug-in into the current browser;

步骤1.2标准浏览器插件对当前浏览器内核进行访问并读取当前浏览器的信息;Step 1.2 The standard browser plug-in accesses the current browser kernel and reads the information of the current browser;

步骤1.3标准浏览器插件再对浏览器读取网站的网页文件进行解析,判断网页文件与当前浏览器是否兼容;Step 1.3 The standard browser plug-in parses the webpage file read by the browser to determine whether the webpage file is compatible with the current browser;

步骤1.4标准浏览器插件再根据当前浏览器内核的类型对解析的网页文件进行一致性调整;Step 1.4 The standard browser plug-in adjusts the consistency of the parsed webpage file according to the type of the current browser kernel;

步骤1.5浏览器将调整后的网页文件进行渲染显示。Step 1.5 The browser renders and displays the adjusted webpage file.

工作流程说明:因为插件由不同的发行商进行插件开发发行,其技术水平良莠不齐,插件程序很可能与其它运行中的程序发生冲突,从而导致诸如各种页面错误,运行时间错误等等现象,阻塞了正常浏览,且不同的浏览器开发标准不一致,导致浏览器插件仅能在特定浏览器中运行,对于不同的浏览器需要发布不同的插件,无法做到插件的统一,为了能够做到适应各个浏览器内型,具体开发的过程是首先定义统一的标准开发平台,标准的浏览器插件是通过标准开发平台开发而来,首先是在标准开发平台上创建标准浏览器插件,最后将标准浏览器插件发送至浏览器上,标准开发平台自带有解析器和类加载器的标准框架,所述标准框架内设置有插件结构,插件结构包括至少一个根目录,在所述根目录下并列建立有至少四个子目录,分别为通用程序集、插件文件、库文件、通用配置,其中通用程序集里面放置有标准浏览器插件常用的通用程序,通用配置内放置有标准浏览器插件常用的配置,库文件内放置有标准浏览器插件常用的库文件等,子目录中的插件文件下还设置有多个插件功能模块,在每一个的功能模块中都含有4个单元,分别是程序集、脚本文件、网页文件、库文件,程序集的作用是定义插件的属性,例如名称、版本、类型等信息,网页文件是具体实现插件的功能,库文件是跟浏览器互动的脚本文件,用户可以在这个4个单元内编写相应程序代码,具体是指的在网页文件下进行编写,从而形成相应的插件功能,标准框架的类加载器根据通用配置对插件文件、通用程序集和库文件进行加载、调用、组合成相应的标准浏览器插件。Workflow description: Because plug-ins are developed and released by different publishers, and their technical levels vary, plug-in programs are likely to conflict with other running programs, resulting in various page errors, runtime errors, etc., blocking normal browsing, and the development standards of different browsers are inconsistent, resulting in browser plug-ins that can only run in specific browsers, different plug-ins need to be released for different browsers, and it is impossible to achieve a unified plug-in. The specific development process is to first define a unified standard development platform. Standard browser plug-ins are developed through standard development platforms. First, standard browser plug-ins are created on the standard development platform, and finally standard browser plug-ins are created. The plug-in is sent to the browser, and the standard development platform is equipped with a standard framework of a parser and a class loader. A plug-in structure is set in the standard frame, and the plug-in structure includes at least one root directory. At least four subdirectories, namely general assembly, plug-in files, library files, and general configuration. The general assembly contains common programs commonly used by standard browser plug-ins, and the general configuration contains common configurations and libraries commonly used by standard browser plug-ins. There are library files commonly used by standard browser plug-ins in the file, and there are multiple plug-in function modules under the plug-in files in the subdirectory, and each function module contains 4 units, which are assembly and script file , webpage files, and library files. The function of the assembly is to define the properties of the plug-in, such as name, version, type and other information. The web page file is to implement the function of the plug-in. Write the corresponding program code in 4 units, specifically refers to writing under the web page file, so as to form the corresponding plug-in function, the class loader of the standard framework loads and calls the plug-in file, general assembly and library file according to the general configuration , combined into corresponding standard browser plug-ins.

标准开发平台内还能够对标准浏览器插件进行试运行,在试运行过程中还存在报警提示,标准开发平台上开发出的标准浏览器插件根据虚拟的网络环境模拟标准浏览器插件在运行时会出现的问题,比如网页无法正常显示,图片无法正常打开,此时会有提示信息,对提示信息进行处理,将标准浏览器插件反应至相应的插件结构的具体位置中,在相应的位置对标准浏览器插件的网页文件进行修改,已达到适应各种不同浏览器内核的需求。The standard browser plug-in can also be tested on the standard development platform, and there are alarms during the trial run. The standard browser plug-in developed on the standard development platform simulates the standard browser plug-in according to the virtual network environment. If there is a problem, such as the web page cannot be displayed normally, the picture cannot be opened normally, there will be a prompt message at this time, and the prompt message will be processed, and the standard browser plug-in will be reflected in the specific position of the corresponding plug-in structure, and the standard The webpage files of the browser plug-in are modified to meet the needs of various browser kernels.

对已经试运行成功或者是返回修改后的再试运行成功的标准浏览器插件进行组织、打包并发送至浏览器,此过程便是将标准浏览器插件载入当前浏览器中的具体过程。Organizing, packaging and sending the standard browser plug-ins that have been successfully tested or returned to the modified test run successfully, and sent to the browser, this process is the specific process of loading the standard browser plug-ins into the current browser.

开发标准浏览器插件有利于统一,在需要开发插件时,在标准开发平台的插件结构下编写相应程序,进而组装,形成具有相应功能的插件,能够减少人力资源的浪费,同时对不同浏览器的类型也能够完全适应。The development of standard browser plug-ins is conducive to unification. When plug-ins need to be developed, corresponding programs are written under the plug-in structure of the standard development platform, and then assembled to form plug-ins with corresponding functions, which can reduce the waste of human resources and at the same time support different browsers. Types are also fully adaptable.

标准开发平台上开发出的标准浏览器插也能够在此进行试运行,运行成功便进入下一步存储浏览器上,访问等,当是试运行不成功,标准浏览器插件将会被返回插件结构,进行错误的修改,已达到所需的要求。The standard browser plug-in developed on the standard development platform can also be tested here. If the operation is successful, it will enter the next step to store the browser, access, etc. When the trial run is unsuccessful, the standard browser plug-in will be returned to the plug-in structure , make the wrong modification, the required requirement has been achieved.

标准浏览器插件能够对当前浏览器内核进行访问读取当前浏览器的信息,值得说明的是,访问过程以及读取信息的过程是本领域公知的常识,故在此不在进行过多的阐述。The standard browser plug-in can access the current browser kernel and read the information of the current browser. It is worth noting that the access process and the process of reading information are common knowledge in the art, so too much elaboration will not be given here.

当前浏览器的渲染引擎在窗口上显示请求到的内容,该内容是浏览器能够读取网站的网页文件,通常情况下,渲染引擎可以显示html、xml等文档及图片,但是对于特殊文件则无法正常渲染,而标准浏览器插件则可以对特殊文件进行渲染,然后在浏览器窗口上显示,特殊的文件比如是PDF文件、CEB文件、Flash Player等等特殊类型的文件。The rendering engine of the current browser displays the requested content on the window. The content is that the browser can read the webpage files of the website. Usually, the rendering engine can display html, xml and other documents and pictures, but it cannot display special files. Normal rendering, while standard browser plug-ins can render special files and then display them on the browser window, such as PDF files, CEB files, Flash Player and other special types of files.

对于无法正常显示的特殊文件,此时标准浏览器插件便能够对网页文件进行解析,通过解析达到能够使得当前浏览器正常识别的网页文件,并在对相应的网页文件进行一致性的调整,从而使得当前浏览器能够正常的渲染显示。For special files that cannot be displayed normally, the standard browser plug-in can analyze the webpage files at this time, and through parsing, the webpage files that can be recognized by the current browser are reached, and the corresponding webpage files are adjusted consistently, so that Enables the current browser to render and display normally.

为了更好实现标准浏览器插件在对网页文件进行解析,并达到解析完整性,进一步地限定,所述步骤1.3中标准浏览器插件再对浏览器读取网站的网页文件进行解析的具体步骤为:In order to better realize that the standard browser plug-in is parsing the webpage file, and achieves the completeness of the analysis, it is further defined, the specific steps for the standard browser plug-in in the step 1.3 to analyze the webpage file that the browser reads the website are as follows: :

步骤1.3.1:标准浏览器插件将网页文件的源文件进行文法分析;Step 1.3.1: the standard browser plug-in performs grammatical analysis on the source file of the web page file;

步骤1.3.2:标准浏览器插件对网页文件的源文件搭建解析树;Step 1.3.2: The standard browser plug-in builds a parse tree for the source file of the web page file;

步骤1.3.3:标准浏览器插件根据当前浏览器内核的类型将解析树进行转换为能够被当前浏览器识别的文档。Step 1.3.3: The standard browser plug-in converts the parse tree into a document that can be recognized by the current browser according to the type of the current browser kernel.

标准浏览器插件在对网页文件进行解析的具体过程,解析网页文件是将文件转化为有意义的结构,即是能够让代码被理解和使用的结构,网页文件通常是一种代码格式,标准浏览器插件先对网页文件的代码进行文法分析,代码格式都有一定的文法规则,文法是指基于文档依据的语法规则,即文档的语言或者是格式,每种可被解析的文件的格式必须具有词汇以及语法规则组成的特定的文法。标准浏览器插件内含有解析器,解析器一般分为语法分析器和词法分析器,值得说明的是语法分析器和词法分析器是本领域内公知的,故在此不在进行过多的阐述,词法分析器主要是词法分析,是将输入分解为符号,符号是语言的词汇表,相当于我们熟悉的字典中的单词,语法分析器主要是对语法进行分析,语法分析是指对语言应用语法的规则,解析器一般分两个部分工作,词法分析器负责将输入分解为合法的符号,语法分析器则根据语言的语法规则分析出文档,解析树根据上述的词法分析和语法分析最后将文档构建为解析树。The specific process of parsing a webpage file by a standard browser plug-in. Parsing a webpage file is to convert the file into a meaningful structure, that is, a structure that allows the code to be understood and used. A webpage file is usually a code format. Standard browsing The browser plug-in first performs grammatical analysis on the code of the web page file. The code format has certain grammatical rules. Grammar refers to the grammatical rules based on the basis of the document, that is, the language or format of the document. The format of each file that can be parsed must have A specific grammar consisting of vocabulary and grammatical rules. The standard browser plug-in contains a parser, and the parser is generally divided into a syntax analyzer and a lexical analyzer. It is worth noting that the syntax analyzer and the lexical analyzer are well known in the art, so I will not elaborate too much here. The lexical analyzer is mainly lexical analysis, which decomposes the input into symbols. The symbol is the vocabulary of the language, which is equivalent to the words in the dictionary we are familiar with. The grammatical analyzer mainly analyzes the grammar. The grammatical analysis refers to the application of grammar to the language. The parser generally works in two parts, the lexical analyzer is responsible for decomposing the input into legal symbols, the grammatical analyzer analyzes the document according to the grammatical rules of the language, and the parse tree finally converts the document according to the above lexical analysis and grammatical analysis Build as a parse tree.

得到的解析树并不是最终的结构,解析器需要将解析树转换为能够为当前浏览器内核识别的文档。The resulting parse tree is not the final structure, and the parser needs to convert the parse tree into a document that can be recognized by the current browser kernel.

该过程更加具体的描述了解析的过程,使得本发明的方案更加完善,通过对网页文件的解析,并将无法渲染的网页文件进行转换能够被当前浏览器识别的文件。This process describes the parsing process in more detail, which makes the solution of the present invention more perfect. By parsing the webpage files, the webpage files that cannot be rendered are converted into files that can be recognized by the current browser.

对于转换位能够识别的文档,因为开发者的开发水平参差不齐,存在较多的人为错误,为了更好的实现本发明,进一步地限定,所述步骤1.4中再根据当前浏览器内核的类型对解析的网页文件进行一致性调整,具体一致性调整的步骤为:For documents that can be identified by the conversion bit, because the developer's development level is uneven, there are many human errors. In order to better realize the present invention, it is further defined. In the step 1.4, according to the type of the current browser kernel Adjust the consistency of the parsed webpage files. The specific steps for adjusting the consistency are:

步骤1.4.1:对文档进行符号的识别并传递至构建器;Step 1.4.1: Recognize the symbol of the document and pass it to the builder;

步骤1.4.2:构建器将接收到的符号重新构建能够适应当前浏览器内核的构建树;Step 1.4.2: The builder reconstructs the received symbols into a build tree that can adapt to the current browser kernel;

步骤1.4.3:构建器根据当前浏览器内核对重新建立的构建树进行符号的修改;Step 1.4.3: The builder modifies the symbols of the re-established construction tree according to the current browser kernel;

步骤1.4.4:将修改后的构建树转换为网页文件。Step 1.4.4: Convert the modified build tree to a web page file.

通过解析器对文档的符号进行识别,符号识别是指根据符号识别的算法,将输入解析变为符号,并将其传递给树构建器,并读取下一个字符,以识别下一个符号,直至处理完所有输入,符号识别主要是对开始标签、结束标签、属性名以及属性值进行识别。Recognize the symbols of the document through the parser. Symbol recognition refers to parsing the input into symbols according to the algorithm of symbol recognition, and passing it to the tree builder, and reading the next character to recognize the next symbol until After processing all the inputs, symbol recognition is mainly to identify the start tag, end tag, attribute name and attribute value.

将构建树构建阶段,将元素附加到树上,每个由符号识别器识别生成的节点将会被构建树进行处理。构建器根据当前浏览器内核重新建立构建树在构建过程中还会对符号进行修改,已到达能够正常渲染的效果。The tree construction phase will be built, elements will be appended to the tree, and each node recognized by the symbol recognizer will be processed by the tree builder. The builder re-establishes the construction tree according to the current browser kernel, and also modifies the symbols during the construction process, which has reached the effect of normal rendering.

为了更加具体的实现本发明,以及实现更好的自适应,进一步地限定,所述步骤1.4.3中构建器对重新建立的构建树进行修改包括对网页文件中源文件的错误或不规范编写进行修复。对网页文件中存在的错误进行修改,主要是修改不规范的书写方法,以及多余符号,达成能够正常渲染的效果。In order to realize the present invention more concretely, and to realize better self-adaptation, it is further defined that in the step 1.4.3, the builder modifies the re-established construction tree including wrong or irregular compilation of the source files in the webpage files Make repairs. Modify the errors in the webpage files, mainly to modify the non-standard writing methods and redundant symbols, so as to achieve the effect of normal rendering.

为了更加具体的实现本发明,进一步地限定,所述修复为增加或者是减少源文件的符号。In order to implement the present invention more specifically, it is further defined that the repair is adding or reducing symbols of the source file.

为了节约程序,节约时间,在对网页文件进行修改后,进一步地限定,在所述步骤1.4.3和步骤1.4.4之间还包括有对修改后的网页文件进行试运行。试运行成功便能够正常的渲染,如果不成功,将会进一步返回修改直至到修改成功为止。In order to save programs and save time, after the webpage file is modified, it is further defined that between the steps 1.4.3 and 1.4.4, a trial run of the modified webpage file is also included. If the trial run is successful, it can be rendered normally. If it is not successful, it will go back to modify until the modification is successful.

为了使在操作过程中,使本发明更加完善,进一步地限定,在所述试运行过程中还设置有报警提示。在试运行过程中当出现不成功的时候,马上提示报警,并显示出报警的信息,便能够更快更准的对网页文件进行修改。In order to make the present invention more perfect during operation, it is further defined that an alarm prompt is also provided during the trial operation. When there is an unsuccessful trial operation, an alarm will be prompted immediately, and the alarm information will be displayed, so that the webpage file can be modified faster and more accurately.

本发明与现有技术相比,具有以下优点及有益效果:Compared with the prior art, the present invention has the following advantages and beneficial effects:

(1)本发明通过标准浏览器插件对网页文件的解析以及一致性的调整,使得网页文件能够正常被渲染出来,有利于节约成本,不影响客户的操作;(1) The present invention uses a standard browser plug-in to analyze and adjust the consistency of webpage files, so that webpage files can be rendered normally, which is beneficial to saving costs and does not affect customer operations;

(2)本发明通过对网页文件的一致性调整,尤其是对特殊的文件,比如是PDF等文件,使得本产品的通用性更强,使用范围更广;(2) The present invention adjusts the consistency of webpage files, especially for special files, such as PDF files, so that the product has stronger versatility and wider application range;

(3)本发明通过在一致性调整后再进行试运行,能够减少错误,提高使用的效率;(3) The present invention can reduce errors and improve the efficiency of use by performing trial operation after consistency adjustment;

(4)本发明通过在试运行中设置报警提示,报警提示能够对错误信息经常报警处理,及时处理相应的错误,节约时间。(4) In the present invention, by setting an alarm prompt during the trial operation, the alarm prompt can often alarm and process error information, deal with corresponding errors in time, and save time.

附图说明Description of drawings

通过阅读参照以下附图对非限制性实施例所作的详细描述,本发明的其他特征、目的和优点将会变得更为明显:Other characteristics, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments with reference to the following drawings:

图1为本发明跨浏览器插件自适应方法的流程图;Fig. 1 is the flowchart of cross-browser plug-in adaptive method of the present invention;

图2为本发明跨浏览器插件对网页文件解析的流程图;Fig. 2 is the flow chart that cross-browser plug-in of the present invention parses webpage file;

图3为本发明跨浏览器插件对网页文件解析后一致性调整的流程图;Fig. 3 is the flowchart of the consistency adjustment after the web page file is parsed by the cross-browser plug-in of the present invention;

图4为本发明标准浏览器插件流程图;Fig. 4 is a flow chart of the standard browser plug-in of the present invention;

图5为本发明标准浏览器插件的插件框架结构示意图;Fig. 5 is the plug-in framework schematic diagram of standard browser plug-in of the present invention;

图6为本发明浏览器组件图。Fig. 6 is a browser component diagram of the present invention.

具体实施方式detailed description

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.

实施例1:Example 1:

本实施例的主要流程,如图1至图6所示:1.一种跨浏览器插件的自适应方法,包括标准浏览器插件,标准浏览器插件对浏览器读取网站的网页文件自适应,具体包括以下步骤:The main flow of this embodiment is shown in Figure 1 to Figure 6: 1. A cross-browser plug-in adaptive method includes a standard browser plug-in, and the standard browser plug-in adapts to the browser to read the web page file of the website, specifically including the following steps:

步骤1.1将所述标准浏览器插件载入当前浏览器;Step 1.1 loads the standard browser plug-in into the current browser;

步骤1.2标准浏览器插件对当前浏览器内核进行访问并读取当前浏览器的信息;Step 1.2 The standard browser plug-in accesses the current browser kernel and reads the information of the current browser;

步骤1.3标准浏览器插件再对浏览器读取网站的网页文件进行解析,判断网页文件与当前浏览器是否兼容;Step 1.3 The standard browser plug-in parses the webpage file read by the browser to determine whether the webpage file is compatible with the current browser;

步骤1.4标准浏览器插件再根据当前浏览器内核的类型对解析的网页文件进行一致性调整;Step 1.4 The standard browser plug-in adjusts the consistency of the parsed webpage file according to the type of the current browser kernel;

步骤1.5浏览器将调整后的网页文件进行渲染显示。Step 1.5 The browser renders and displays the adjusted webpage file.

具体的实施方式:对于基于不同渲染引擎开发的网页工程,其格式及语法是不一样的,且很多网站不按照W3C标准进行设计和研发,导致渲染引擎和标准浏览器插件对网页文件进行解析时,无法正常显示。对于这种情况,需要对解析后的网页文件进行调整,将解析后的网页文件进行格式完善和调整,实现标准浏览器插件的自适应。Specific implementation method: For webpage projects developed based on different rendering engines, their formats and grammars are different, and many websites are not designed and developed in accordance with W3C standards, resulting in rendering engines and standard browser plug-ins when parsing webpage files. , cannot be displayed properly. In this case, it is necessary to adjust the parsed webpage file, improve and adjust the format of the parsed webpage file, and realize the self-adaptation of the standard browser plug-in.

标准浏览器插件是根据标准开发平台开发而来,首先需要先定义标准开发平台,在标准开发平台上设置出标准浏览器插件,标准开发平台带有解析器和类加载器,标准开发平台的标准框架内设置插件结构,插件结构是包括至少一个根目录,在根目录下并列建立有通用程序集、插件文件、库文件、通用配置的子目录,其中通用程序集文件中仅存有常用的程序集,通用配置为插件的基本配置,库文件为常用的库文件。每个子目录之间具有物理隔离性,在插件文件下按照功能的不同设置不同的插件功能模块,并且各插件功能模块之间同时也具有物理隔离性,设置该插件结构,并把插件相应的功能进行分类,每一个插件功能模块为一个功能,该插件功能模块内有实现该功能需要的程序集、脚本文件、页面文件图片等全部文件,在此插件功能模块下编写相应的程序,便能够实现相应的功能。The standard browser plug-in is developed according to the standard development platform. First, the standard development platform needs to be defined, and the standard browser plug-in is set on the standard development platform. The standard development platform has a parser and a class loader. The standard development platform standard The plug-in structure is set in the framework. The plug-in structure includes at least one root directory. Under the root directory, there are subdirectories of general assembly, plug-in files, library files, and general configuration. Among them, only commonly used programs are stored in the general assembly file. The common configuration is the basic configuration of the plug-in, and the library file is the commonly used library file. There is physical isolation between each subdirectory. Different plug-in function modules are set according to different functions under the plug-in file, and each plug-in function module also has physical isolation at the same time. Set the plug-in structure and put the plug-in corresponding function For classification, each plug-in function module is a function. The plug-in function module contains all the files required to realize the function, such as assembly, script file, page file and picture. Write the corresponding program under this plug-in function module, and then it can be realized. corresponding function.

插件功能模块是根据插件的基本架构模式由此而来,一般一个完整的插件是由4个部分组成,分别是程序集、脚本文件、库文件和网页文件,通常库文件的作用是定义插件的属性,例如名称、版本、类型等;而网页文件页面内可以包含图片、链接,甚至音乐、程序等非文字元素,是具体实现插件的功能,用户可以根据需求,在网页文件下编写,以及将插件的目录按照开发标准平台的目录进行组织存放。The plug-in function module is derived from the basic architecture model of the plug-in. Generally, a complete plug-in is composed of 4 parts, which are assembly, script file, library file and web page file. Usually, the role of the library file is to define the plug-in. Attributes, such as name, version, type, etc.; while the webpage file page can contain pictures, links, and even non-text elements such as music and programs, which are the functions of plug-ins. The directory of the plug-in is organized and stored according to the directory of the development standard platform.

开发出标准浏览器插件后,每一个功能都将被封装在插件功能模块中,插件功能模块内存放有更多的源文件目录,每一个标准浏览器插件都是具有相应的功能以及相应的界面,业务逻辑和数据等代码组成,由于每个插件功能模块之间也具有物理隔离性,开发者可以开发自己的功能,类加载器对这些代码进行解析,并在这上面进行独立测试、部署以及升级,一旦开发完成后,便在开发标准平台上进行由类加载器进行组合。标准开发平台上类加载器对标准浏览器插件进行解析、运行,按照标准开发平台的标准框架,标准框架内有较多的插件模块。After the standard browser plug-in is developed, each function will be encapsulated in the plug-in function module. There are more source file directories stored in the plug-in function module. Each standard browser plug-in has corresponding functions and corresponding interfaces. , business logic, data and other codes, because each plug-in function module is also physically isolated, developers can develop their own functions, and the class loader parses these codes, and independently tests, deploys and Upgrades, once developed, are assembled on the development standard platform by classloaders. The class loader on the standard development platform parses and runs the standard browser plug-in. According to the standard framework of the standard development platform, there are more plug-in modules in the standard framework.

标准浏览器插件开发完成将需要进行试运行,试运行成功后将打包发送至浏览器。After the development of the standard browser plug-in is completed, a trial run will be required. After the trial run is successful, it will be packaged and sent to the browser.

标准浏览器插件先对当前浏览器类型进行访问并读取相应的信息,当前浏览器读取网站的网页文件无法显示时候,则标准浏览器插件对网页进行解析以及一致性的标准,具体解析和调整以下举例说明,以网页文件为HTML的格式进行说明,The standard browser plug-in first accesses the current browser type and reads the corresponding information. When the current browser reads the web page file of the website and cannot display it, the standard browser plug-in analyzes the web page and conforms to the standard. The specific analysis and Adjust the following examples to illustrate with the HTML format of the web page file,

对于客户端HTML文件,标准浏览器插件在获取到该文件时,需要对文件进行一致性调整。具体解析的过程为:解析分为语法分析和词法分析两个子过程,语法分析是将输入分解为符合,符号是语言的词汇表,语法分析是指对语言应用的法则,词法分析负责将输入分解为合法的符号,根据语言的语法规则分析HTML的文档结构,从而构建解析树。For the client HTML file, when the standard browser plug-in obtains the file, it needs to adjust the consistency of the file. The specific parsing process is as follows: parsing is divided into two sub-processes: grammar analysis and lexical analysis. Grammar analysis is to decompose the input into symbols. Symbols are the vocabulary of the language. Grammar analysis refers to the rules applied to the language. Lexical analysis is responsible for decomposing the input. For legal symbols, analyze the document structure of HTML according to the grammar rules of the language, so as to build a parse tree.

得到解析树后,标准浏览器插件对解析树进行转换,转换为能够被当前浏览器识别的网页文档,及时转变为了能够识别的网页文档,但是存在网页文档编写错误或者格式错误可能性,还需要对网页文档进行一致性的调整,具体一致性调整的过程为:After obtaining the parse tree, the standard browser plug-in converts the parse tree into a web document that can be recognized by the current browser, and converts it into a web document that can be recognized in time, but there is a possibility that the web document is written incorrectly or in the wrong format. Adjust the consistency of web documents, the specific consistency adjustment process is as follows:

1)符号识别1) Symbol recognition

html的符号包括开始标签、结束标签、属性名及属性值。符号识别是指根据符号识别算法,将输入解析为符号,并将其传递给树构建器,并读取下一个字符,以识别下一个符号,直至处理完所有输入。HTML symbols include start tags, end tags, attribute names, and attribute values. Symbol recognition means that according to the symbol recognition algorithm, the input is parsed into symbols and passed to the tree builder, and the next character is read to recognize the next symbol until all inputs are processed.

符号识别算法相对较为复杂,用HTML页面来解释这个原理:The symbol recognition algorithm is relatively complicated, and this principle is explained with an HTML page:

<html><html>

<body><body>

Hello worldhello world

</body></body>

</html></html>

初始状态为“Data State”,当遇到“<”字符,状态变为“Tag open state”,读取一个a-z的字符将产生一个开始标签符号,状态相应变为“Tag name state”,一直保持这个状态直到读取到“>”,每个字符都附加到这个符号名上,例子中创建的是一个html符号。当读取到“>”,当前的符号就完成了,此时,状态回到“Data state”,“<body>”重复这一处理过程。到这里,html和body标签都识别出来了。现在,回到“Data state”,读取“Hello world”中的字符“H”将创建并识别出一个字符符号,这里会为“Hello world”中的每个字符生成一个字符符号。这样直到遇到“</body>”中的“<”。现在,又回到了“Tag open state”,读取下一个字符“/”将创建一个闭合标签符号,并且状态转移到“Tag name state”,还是保持这一状态,直到遇到“>”。然后,产生一个新的标签符号并回到“Data state”。后面的“</html>”将和“</body>”一样处理。The initial state is "Data State". When a "<" character is encountered, the state changes to "Tag open state". Reading a character from a to z will generate a start tag symbol, and the state changes to "Tag name state" accordingly. Keep this state until ">" is read, and each character is appended to the symbol name. In the example, an html symbol is created. When ">" is read, the current symbol is completed. At this time, the state returns to "Data state", and "<body>" repeats this process. At this point, both html and body tags are recognized. Now, going back to the "Data state", reading the character "H" in "Hello world" will create and recognize a glyph, here a glyph will be generated for each character in "Hello world". Do this until you encounter the "<" in "</body>". Now, back to the "Tag open state", reading the next character "/" creates a closed tag symbol, and the state transitions to the "Tag name state", which remains until a ">" is encountered. Then, generate a new label symbol and go back to "Data state". The following "</html>" will be treated the same as "</body>".

2)重新搭建构建树2) Rebuild the build tree

在树的构建阶段,将修改以Document为根的DOM树,将元素附加到树上,每个由符号识别器识别生成的节点将会被树构造器进行处理,规范中定义了每个符号相对应的Dom元素,对应的Dom元素将会被创建。这些元素除了会被添加到Dom树上,还将被添加到开放元素堆栈中。这个堆栈用来纠正嵌套的未匹配和未闭合标签,这个算法也是用状态机来描述,所有的状态采用插入模式。In the tree construction phase, the DOM tree with Document as the root will be modified, and elements will be appended to the tree. Each node generated by the symbol recognizer will be processed by the tree constructor. Each symbol is defined in the specification. The corresponding Dom element, the corresponding Dom element will be created. In addition to being added to the DOM tree, these elements will also be added to the open element stack. This stack is used to correct nested unmatched and unclosed tags. This algorithm is also described by a state machine, and all states use insert mode.

继续阐述构建树的原理:Continue to explain the principle of building a tree:

此阶段将符号识别阶段生成的符号序列作为输入,然后开始构建。首先是“initialmode”,接收到html符号后将转换为“before html”模式,在这个模式中对这个符号进行再处理。此时,创建了一个HTMLHtmlElement元素,并将其附加到根Document对象上。状态此时变为“before head”,接收到body符号时,即使这里没有head符号,也将自动创建一个HTMLHeadElement元素并附加到树上。现在,转到“in head”模式,然后是“after head”。到这里,body符号会被再次处理,将创建一个HTMLBodyElement并插入到树中,同时,转移到“in body”模式。然后,接收到字符串“Hello world”的字符符号,第一个字符将导致创建并插入一个text节点,其他字符将附加到该节点。接收到body结束符号时,转移到“afterbody”模式,接着接收到html结束符号,这个符号意味着转移到了“after after body”模式,当接收到文件结束符时,整个解析过程结束。This stage takes as input the sequence of symbols produced by the symbol recognition stage and starts building. The first is "initialmode", which will convert to "before html" mode after receiving the html symbol, in which the symbol is reprocessed. At this point, an HTMLHtmlElement element is created and attached to the root Document object. The state changes to "before head" at this point, and when the body symbol is received, even if there is no head symbol here, an HTMLHeadElement element will be automatically created and appended to the tree. Now, go to "in head" mode, then "after head". At this point, the body symbol will be processed again, an HTMLBodyElement will be created and inserted into the tree, and at the same time, transferred to "in body" mode. Then, the character notation for the string "Hello world" is received, the first character will cause a text node to be created and inserted, and the other characters will be appended to it. When receiving the end of body symbol, transfer to "afterbody" mode, and then receive the end of html symbol, this symbol means transfer to "after after body" mode, when the end of file is received, the entire parsing process ends.

3)自适应调整3) Adaptive adjustment

由于某些HTML页面是按照Gecko的标准来编写,而某些windows用户则是按照Trident的标准来编写,还有一些则是按照Webkit的标准来编写,不同渲染引擎之间识别符号的格式不一致,插件自适应根据当前浏览器的内核对输入文件进行分析,自动修改和完善元素,使文件可以正常显示。例如:Since some HTML pages are written according to the Gecko standard, some Windows users are written according to the Trident standard, and some are written according to the Webkit standard, the format of identification symbols between different rendering engines is inconsistent, The plug-in self-adaptation analyzes the input file according to the kernel of the current browser, automatically modifies and improves the elements, so that the file can be displayed normally. E.g:

<table><table>

<table><table>

<tr><td>inner table</td></tr><tr><td>inner table</td></tr>

</table></table>

<tr><td>outer table</td></tr><tr><td>outer table</td></tr>

</table></table>

当前浏览器内核为webkit,通过自适应插件对输入文件进行分析和处理后可正常渲染。如果没有自适应插件,webkit则会将嵌套的表格变为两个兄弟表格:The current browser kernel is webkit, and the input file can be rendered normally after analyzing and processing the input file through the adaptive plug-in. If there is no adaptive plug-in, webkit will turn the nested table into two sibling tables:

<table><table>

<tr><td>outer table</td></tr><tr><td>outer table</td></tr>

</table></table>

<table> <table>

<tr><td>inner table</td></tr><tr><td>inner table</td></tr>

</table></table>

另一方面,对于某些编写不规范、错误的HTML页面,自适应插件可自动对标签和元素进行修复。On the other hand, for some irregularly written and wrong HTML pages, the adaptive plug-in can automatically repair tags and elements.

当对于客户端为CSS文件,自适应插件在获取到该文件时,需要对文件进行一致性调整。具体设置有:When the client is a CSS file, when the adaptive plug-in obtains the file, it needs to adjust the consistency of the file. The specific settings are:

不同于html,css属于上下文无关文法,可以用类似BNF的格式来定义。一个规则集合具有一个或是可选个数的多个选择器,这些选择器以逗号和空格(S表示空格)进行分隔。每个规则集合包含大括号及大括号中的一条或多条以分号隔开的声明。声明和选择器在后面进行定义。Unlike html, css is a context-free grammar and can be defined in a format similar to BNF. A rule set has one or an optional number of selectors separated by commas and spaces (S means space). Each rule set consists of braces and one or more semicolon-separated declarations within the braces. Declarations and selectors are defined later.

例如对于webkit内核的浏览器使用Flex和Bison解析生成器从CSS语法文件中自动生成解析器。Bison创建一个自底向上的解析器,Firefox使用自顶向下解析器。它们都是将每个css文件解析为样式表对象,每个对象包含css规则,css规则对象包含选择器和声明对象,以及其他一些符合css语法的对象。自适应插件根据解析器生成的不同结果进行调整,实现CSS的自适应。For example, browsers with a webkit core use Flex and Bison parser generators to automatically generate parsers from CSS grammar files. Bison creates a bottom-up parser, Firefox uses a top-down parser. They all parse each css file into a style sheet object, each object contains css rules, css rule objects contain selectors and declaration objects, and some other objects that conform to css syntax. The adaptive plug-in is adjusted according to the different results generated by the parser to realize the self-adaptation of CSS.

在对网页文件进行自适应调整后进行试运行,该试运行有利于检查错误,便于修改,同时试运行时还设置有报警提示,在遇到问题时,即使提示更加高效。The trial run is carried out after the webpage file is adaptively adjusted. This trial run is beneficial to check errors and facilitate modification. At the same time, an alarm prompt is set during the trial run. When encountering a problem, even the prompt is more efficient.

可以理解的是,根据本发明一个实施例的解析器的结构,例如词法分析器和语法分析器等部件的工作原理和工作过程都是现有技术,且为本领域的技术人员所熟知,这里就不再进行详细描述。It can be understood that the structure of the parser according to an embodiment of the present invention, such as the working principle and working process of components such as a lexical analyzer and a syntax analyzer, are all prior art and well known to those skilled in the art. Here No more detailed description will be given.

尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, those skilled in the art can understand that various changes, modifications, substitutions and modifications can be made to these embodiments without departing from the principle and spirit of the present invention. The scope is defined by the claims and their equivalents.

Claims (7)

1.一种跨浏览器插件的自适应方法,包括标准浏览器插件,其特征在于:所述标准浏览器插件对浏览器读取网站的网页文件自适应的调整,具体包括以下步骤:1. an adaptive method of cross-browser plug-in, comprising standard browser plug-in, it is characterized in that: described standard browser plug-in is to the webpage file adaptive adjustment of browser reading website, specifically comprises the following steps: 步骤1.1将所述标准浏览器插件载入当前浏览器;Step 1.1 loads the standard browser plug-in into the current browser; 步骤1.2标准浏览器插件对当前浏览器内核进行访问并读取当前浏览器的信息;Step 1.2 The standard browser plug-in accesses the current browser kernel and reads the information of the current browser; 步骤1.3标准浏览器插件再对浏览器读取网站的网页文件进行解析,判断网页文件与当前浏览器是否兼容;Step 1.3 The standard browser plug-in parses the webpage file read by the browser to determine whether the webpage file is compatible with the current browser; 步骤1.4标准浏览器插件再根据当前浏览器内核的类型对解析的网页文件进行一致性调整;Step 1.4 The standard browser plug-in adjusts the consistency of the parsed webpage file according to the type of the current browser kernel; 步骤1.5浏览器将调整后的网页文件进行渲染显示。Step 1.5 The browser renders and displays the adjusted webpage file. 2.根据权利要求1所述的一种跨浏览器插件的自适应方法,其特征在于:所述步骤1.3中标准浏览器插件再对浏览器读取网站的网页文件进行解析的具体步骤为:2. the self-adaptive method of a kind of cross-browser plug-in according to claim 1, is characterized in that: standard browser plug-in in described step 1.3 the concrete steps that the webpage file that browser reads website is analyzed again is: 步骤1.3.1:标准浏览器插件将网页文件的源文件进行文法分析;Step 1.3.1: the standard browser plug-in performs grammatical analysis on the source file of the web page file; 步骤1.3.2:文法分析后,标准浏览器插件对网页文件的源文件搭建解析树;Step 1.3.2: After grammar analysis, the standard browser plug-in builds a parse tree for the source file of the web page file; 步骤1.3.3:标准浏览器插件根据当前浏览器内核的类型将解析树进行转换为能够被当前浏览器识别的文档。Step 1.3.3: The standard browser plug-in converts the parse tree into a document that can be recognized by the current browser according to the type of the current browser kernel. 3.根据权利要求2所述的一种跨浏览器插件的自适应方法,其特征在于:所述步骤1.4中再根据当前浏览器内核的类型对解析的网页文件进行一致性调整,具体一致性调整的步骤为:3. the self-adaptive method of a kind of cross-browser plug-in according to claim 2, it is characterized in that: in described step 1.4, carry out consistency adjustment to the webpage file of parsing again according to the type of current browser kernel, concrete consistency The adjustment steps are: 步骤1.4.1:对能够被当前浏览器识别的文档进行符号的识别并传递至标准浏览器插件的构建器上;Step 1.4.1: Recognize the symbols of the document that can be recognized by the current browser and pass it to the builder of the standard browser plug-in; 步骤1.4.2:所述构建器将接收到的符号重新构建能够适应当前浏览器内核的构建树;Step 1.4.2: the builder reconstructs the received symbols into a construction tree that can adapt to the current browser kernel; 步骤1.4.3:构建器根据当前浏览器内核对重新建立的构建树进行符号的修改;Step 1.4.3: The builder modifies the symbols of the re-established construction tree according to the current browser kernel; 步骤1.4.4:将修改后的构建树转换为能够被当前浏览器渲染的网页文件。Step 1.4.4: Convert the modified construction tree into a web page file that can be rendered by the current browser. 4.根据权利要求3所述的一种跨浏览器插件的自适应方法,其特征在于:所述步骤1.4.3中构建器对重新建立的构建树进行修改包括对网页文件中源文件的错误或不规范编写进行修复。4. The adaptive method of a kind of cross-browser plug-in according to claim 3, it is characterized in that: in the described step 1.4.3, builder revises the re-established construction tree and includes the error of the source file in the webpage file Or non-standard writing to fix. 5.根据权利要求4所述的一种跨浏览器插件的自适应方法,其特征在于:所述修复为增加或者是减少源文件的符号。5. A cross-browser plug-in adaptive method according to claim 4, characterized in that: said repair is to increase or decrease the symbol of the source file. 6.根据权利要求3所述的一种跨浏览器插件的自适应方法,其特征在于:在所述步骤1.4.3和步骤1.4.4之间还包括有对修改后的网页文件进行试运行。6. the self-adaptive method of a kind of cross-browser plug-in according to claim 3, is characterized in that: between described step 1.4.3 and step 1.4.4, also comprise that the webpage file after modification is carried out test run . 7.据权利要求6的一种跨浏览器插件的自适应方法,其特征在于:在所述试运行过程中还设置有报警提示。7. A cross-browser plug-in adaptive method according to claim 6, characterized in that: an alarm prompt is also set during the trial run.
CN201710282674.9A 2017-04-26 2017-04-26 A kind of adaptive approach of browser-cross plug-in unit Pending CN107102877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710282674.9A CN107102877A (en) 2017-04-26 2017-04-26 A kind of adaptive approach of browser-cross plug-in unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710282674.9A CN107102877A (en) 2017-04-26 2017-04-26 A kind of adaptive approach of browser-cross plug-in unit

Publications (1)

Publication Number Publication Date
CN107102877A true CN107102877A (en) 2017-08-29

Family

ID=59656349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710282674.9A Pending CN107102877A (en) 2017-04-26 2017-04-26 A kind of adaptive approach of browser-cross plug-in unit

Country Status (1)

Country Link
CN (1) CN107102877A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897550A (en) * 2018-06-08 2018-11-27 江苏中威科技软件系统有限公司 The system and method for program deployment, access, upgrading is realized by encapsulation browser
CN110083383A (en) * 2019-03-18 2019-08-02 平安普惠企业管理有限公司 Browser style compatibility method, device, computer equipment and storage medium
CN111274520A (en) * 2020-02-20 2020-06-12 北京百度网讯科技有限公司 Web resource auditing method, device, equipment and medium
CN111695076A (en) * 2020-06-15 2020-09-22 荆门汇易佳信息科技有限公司 Cross-browser webpage compatibility standard construction method based on hypertext 5
CN112511607A (en) * 2020-11-18 2021-03-16 上海七牛信息技术有限公司 Edge node system of content distribution network
CN113312123A (en) * 2020-02-27 2021-08-27 富士胶片商业创新有限公司 Information processing apparatus, information processing method, and computer-readable medium
CN114518912A (en) * 2022-02-21 2022-05-20 度小满科技(北京)有限公司 Page loading method, device and equipment and readable storage medium
CN114780164A (en) * 2022-02-28 2022-07-22 深圳开源互联网安全技术有限公司 Method and system for screening webpage information based on browser plug-in
CN115270028A (en) * 2022-07-29 2022-11-01 招商局金融科技有限公司 Browser document display method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1606007A (en) * 2003-10-07 2005-04-13 国际商业机器公司 Web browser command button for client support
CN1959675A (en) * 2005-11-02 2007-05-09 国际商业机器公司 Method and browser for extending marking
CN101122861A (en) * 2007-09-30 2008-02-13 田园 Method for extending object, function or variable of browser
CN102982113A (en) * 2012-11-08 2013-03-20 山东大学 Page loading method for browser based on content grouping of Android system
US8667480B1 (en) * 2010-04-19 2014-03-04 Google Inc. Automatically updating browser extensions, and applications thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1606007A (en) * 2003-10-07 2005-04-13 国际商业机器公司 Web browser command button for client support
CN1959675A (en) * 2005-11-02 2007-05-09 国际商业机器公司 Method and browser for extending marking
CN101122861A (en) * 2007-09-30 2008-02-13 田园 Method for extending object, function or variable of browser
US8667480B1 (en) * 2010-04-19 2014-03-04 Google Inc. Automatically updating browser extensions, and applications thereof
CN102982113A (en) * 2012-11-08 2013-03-20 山东大学 Page loading method for browser based on content grouping of Android system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SHANGBOLEI: "使用FireBreath写浏览器插件", 《HTTPS://BLOG.CSDN.NET/SHANGBOLEI/ARTICLE/DETAILS/52457488》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897550A (en) * 2018-06-08 2018-11-27 江苏中威科技软件系统有限公司 The system and method for program deployment, access, upgrading is realized by encapsulation browser
CN110083383A (en) * 2019-03-18 2019-08-02 平安普惠企业管理有限公司 Browser style compatibility method, device, computer equipment and storage medium
CN111274520A (en) * 2020-02-20 2020-06-12 北京百度网讯科技有限公司 Web resource auditing method, device, equipment and medium
CN111274520B (en) * 2020-02-20 2023-08-15 北京百度网讯科技有限公司 Webpage resource auditing method, device, equipment and medium
CN113312123A (en) * 2020-02-27 2021-08-27 富士胶片商业创新有限公司 Information processing apparatus, information processing method, and computer-readable medium
CN111695076A (en) * 2020-06-15 2020-09-22 荆门汇易佳信息科技有限公司 Cross-browser webpage compatibility standard construction method based on hypertext 5
CN112511607A (en) * 2020-11-18 2021-03-16 上海七牛信息技术有限公司 Edge node system of content distribution network
CN114518912A (en) * 2022-02-21 2022-05-20 度小满科技(北京)有限公司 Page loading method, device and equipment and readable storage medium
CN114518912B (en) * 2022-02-21 2023-04-25 度小满科技(北京)有限公司 Page loading method, device, equipment and readable storage medium
CN114780164A (en) * 2022-02-28 2022-07-22 深圳开源互联网安全技术有限公司 Method and system for screening webpage information based on browser plug-in
CN114780164B (en) * 2022-02-28 2023-04-25 深圳开源互联网安全技术有限公司 Method and system for screening webpage information based on browser plug-in
CN115270028A (en) * 2022-07-29 2022-11-01 招商局金融科技有限公司 Browser document display method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107102877A (en) A kind of adaptive approach of browser-cross plug-in unit
US7240279B1 (en) XML patterns language
Holub Compiler design in C
US8201153B2 (en) Configurable Java Server pages processing
US9626345B2 (en) XML streaming transformer (XST)
US7506324B2 (en) Enhanced compiled representation of transformation formats
CN100578496C (en) Method and system for dynamically generating web pages based on template
US6594823B1 (en) Method and system for representing a high-level programming language data structure in a mark-up language
US20040128614A1 (en) Real time internationalization of web pages with embedded server-side code
US20020143823A1 (en) Conversion system for translating structured documents into multiple target formats
US20040205565A1 (en) XML based report generator
CN111459537B (en) Redundant code removal method, device, equipment and computer-readable storage medium
CN102693323B (en) Cascading style sheet resolving method, resolver, webpage presentation method and server
JP2002149415A (en) Structure restoration system, syntax analysis system and its method, conversion system, computer device, storage medium, and program transmitting device
US20080209395A1 (en) Automatic code replacement
US7505988B2 (en) XML validation processing
US20090083294A1 (en) Efficient xml schema validation mechanism for similar xml documents
US7962919B2 (en) Apparatus and method for modifying an initial event queue for extending an XML processor&#39;s feature set
US6772395B1 (en) Self-modifying data flow execution architecture
US20040221228A1 (en) Method and apparatus for domain specialization in a document type definition
Golubovsky et al. Yhc. Core–from Haskell to Core
CN112650479B (en) Webpage CSS structure automatic generation method and storage medium
US20050234924A1 (en) Automated patching of code for schema derived classes
EP1644826B1 (en) Modular server architecture
Klusener et al. Language standardization needs grammarware

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170829

RJ01 Rejection of invention patent application after publication