CN109522500B - Webpage display method, device, terminal and storage medium - Google Patents

Webpage display method, device, terminal and storage medium Download PDF

Info

Publication number
CN109522500B
CN109522500B CN201811415503.XA CN201811415503A CN109522500B CN 109522500 B CN109522500 B CN 109522500B CN 201811415503 A CN201811415503 A CN 201811415503A CN 109522500 B CN109522500 B CN 109522500B
Authority
CN
China
Prior art keywords
webview
webpage
webview control
accessed
uniform resource
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
CN201811415503.XA
Other languages
Chinese (zh)
Other versions
CN109522500A (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.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology 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 Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN201811415503.XA priority Critical patent/CN109522500B/en
Publication of CN109522500A publication Critical patent/CN109522500A/en
Application granted granted Critical
Publication of CN109522500B publication Critical patent/CN109522500B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a webpage display method, a webpage display device, a webpage display terminal and a webpage display storage medium. The method comprises the following steps: acquiring a uniform resource locator of a webpage to be accessed; determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information; and displaying and rendering the webpage to be accessed according to the target WebView control. According to the embodiment of the invention, the WebView control for loading the webpage to be accessed can be dynamically determined when the webpage is loaded by pre-configuring the configuration information of the WebView control, the WebView control which is more stable and more suitable for the webpage to be accessed is utilized to display and render the webpage to be accessed, a basis is provided for flexible switching of the WebView control when the webpage is abnormally loaded, and the display efficiency and performance of the webpage in the terminal are improved.

Description

Webpage display method, device, terminal and storage medium
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a webpage display method, a webpage display device, a webpage display terminal and a webpage display storage medium.
Background
With the rapid development of internet technology, more and more fields provide browsing web pages for users, and correspondingly, more and more users browse the web pages by using terminals, so as to realize the operation of the web pages and the acquisition and interaction of information. However, since the usage habits and usage environments of users are different, there are various operating environments such as the types of terminals used by different users, the versions of integrated systems in the terminals, and the versions of APPs used in the terminals, and further, the compatibility of displaying the same web page on different terminals is poor, resulting in abnormal display of the web page.
In the prior art, each webpage is developed in a targeted manner, that is, display modes of the same webpage in different operating environments are developed for the same webpage, that is, WebView controls of the same webpage in different operating environments are determined. And determining the WebView control corresponding to the webpage to be loaded according to the operating environment, so as to load and display the webpage, and improving the display effect of the webpage in different terminals.
However, in the prior art, the development workload is huge, the web page developed by a third party has no permission to be developed in a targeted manner, and when the web page is loaded and has a problem, a solution cannot be provided immediately, so that the display efficiency and performance of the web page in the terminal are reduced.
Disclosure of Invention
The embodiment of the invention provides a webpage display method, a webpage display device, a terminal and a storage medium, which can dynamically determine a WebView control for loading a webpage to be accessed and improve the display efficiency and performance of the webpage in the terminal.
In a first aspect, an embodiment of the present invention provides a method for displaying a web page, including:
acquiring a uniform resource locator of a webpage to be accessed;
determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information;
and displaying and rendering the webpage to be accessed according to the target WebView control.
In a second aspect, an embodiment of the present invention provides a web page display apparatus, including:
the URL acquisition module is used for acquiring a uniform resource locator of a webpage to be accessed;
the target control determining module is used for determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the preset WebView control configuration information;
and the webpage display module is used for displaying and rendering the webpage to be accessed according to the target WebView control.
In a third aspect, an embodiment of the present invention provides a terminal, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the web page display method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a web page display method according to any embodiment of the present invention.
Before the webpage to be accessed is opened, the embodiment of the invention determines to open the target WebView control of the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information by acquiring the uniform resource locator of the webpage to be accessed, thereby displaying and rendering the webpage to be accessed by utilizing the target WebView control. According to the embodiment of the invention, the WebView control for loading the webpage to be accessed can be dynamically determined when the webpage is loaded by pre-configuring the configuration information of the WebView control, the WebView control which is more stable and more suitable for the webpage to be accessed is utilized to display and render the webpage to be accessed, a basis is provided for flexible switching of the WebView control when the webpage is abnormally loaded, and the display efficiency and performance of the webpage in the terminal are improved.
Drawings
Fig. 1 is a flowchart of a web page display method according to an embodiment of the present invention;
fig. 2 is a flowchart of a web page display method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of determining a target WebView control according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a web page display device according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and that no limitation of the invention is intended. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
Example one
Fig. 1 is a flowchart of a web page display method according to an embodiment of the present invention, where the embodiment is applicable to displaying a web page, and the method can be executed by a web page display device. The webpage display method and the webpage display device of the embodiment of the invention can be operated in terminals such as mobile phones, tablet computers and computers which can browse webpages, android systems or apple systems can be installed in mobile terminals such as mobile phones, other systems such as Windows can be installed in terminals such as computers, and browsers or application programs for browsing webpages can be installed in the mobile terminals or the terminals. The present embodiment does not limit the model of the mobile terminal or the terminal, the version of the installation system, and the version of the installation application program. The method specifically comprises the following steps:
and step 110, acquiring the uniform resource locator of the webpage to be accessed.
In the specific embodiment of the present invention, the to-be-accessed webpage may refer to a webpage that is about to be opened but is not yet displayed, may be a browsed webpage pointed to by a user click operation, may also be a webpage pointed to by a jump between pages caused by a page function, and the like, and the to-be-accessed webpage may originate from a browser or an APP, and the like. A Uniform Resource Locator (URL) refers to a unique address in the internet that is configured for a standard Resource. Correspondingly, the URL of the webpage to be accessed can be obtained before the webpage to be accessed is opened.
And step 120, determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the preset WebView control configuration information.
In the specific embodiment of the invention, the WebView control is a control capable of rendering and displaying the loaded webpage, so that the webpage can be easily embedded into the APP, and the WebView control can also be directly used as the webpage layout to be mutually called with script languages such as JavaScript and the like, thereby realizing the rendering and display of the webpage. According to different terminal models, different versions of an installation system in the terminal and different versions of an installation application program in the terminal, various corresponding and applicable WebView controls exist, so that the selection of the WebView controls is particularly important for the display effect of the webpage according to the running environment of the webpage.
In the embodiment, in order to reduce the workload of webpage development and avoid performing targeted mass development on the same webpage in different operating environments, the WebView control configuration information is selected to be pre-configured for each APP and used for indicating the WebView control which is applicable or not applicable to the webpage and the WebView control which is applicable to the APP in the current operating environment. Specifically, the WebView control configuration information comprises a white list, a black list and a WebView control list supported under the current operating environment; the white list and the black list are both configured with at least one uniform resource locator and a WebView control list associated with the at least one uniform resource locator. It can be understood that the WebView control list supported in the current operating environment includes at least one WebView control, which is a WebView control applicable to the APP in the current operating environments such as the terminal model, the system version, and the APP version. The white list comprises a URL and a WebView control list corresponding to at least one webpage, and is used for indicating the WebView control applicable to the webpage. The blacklist comprises a URL and a WebView control list corresponding to at least one webpage, and is used for indicating the WebView control which is not applicable to the webpage. The applicable condition means that the WebView control can normally display the associated webpage, and the inapplicable condition means that the WebView control has serious abnormity on the display of the associated webpage.
In this embodiment, for the WebView control lists associated with URLs in the white list and the WebView control lists supported in the current operating environment, the display stability of each WebView control for the web page may be ranked, and each WebView control may be arranged in the WebView control lists from high to low according to the display stability. And on the contrary, for the WebView control lists associated with the URLs in the blacklist, arranging the WebView controls in the WebView control lists from low display stability to high display stability. The display stability of each WebView control can be determined according to indexes or information such as the integrity of webpage display, the regularity of webpage typesetting, the abnormal condition of webpage display, user feedback and the like. Therefore, in the process of determining the target WebView control of the webpage to be accessed, invalid matching of all WebView controls in the WebView control list is avoided, and subsequent determination operation is carried out according to the WebView controls in the WebView control list, wherein the first WebView control is successfully or unsuccessfully matched, so that the determination efficiency of the target WebView control is improved.
In this embodiment, the WebView control configuration information of various APPs may be pre-stored in the server, so that the terminal may select a suitable opportunity to send a network request to the server to obtain the WebView control configuration information of the APP issued by the server, thereby ensuring normal display of a webpage in the APP. Illustratively, the embodiment can acquire the WebView control configuration information when the APP is installed and used for the first time, can acquire the WebView control configuration information when the APP is updated and used, and can also acquire the WebView control configuration information in real time or at regular time during the use process of the user, so as to ensure that the WebView control configuration information configured in the terminal is accurate. And determining a target WebView control for opening the webpage to be accessed according to the URL of the webpage to be accessed and the configuration information of the WebView control pre-configured in the terminal.
Specifically, for a to-be-accessed webpage of an APP, firstly, a URL of the to-be-accessed webpage is matched with a white list of the APP to determine whether a WebView control applicable to the to-be-accessed webpage exists.
And if the white list has the URL of the webpage to be accessed, matching the WebView control list applicable to the webpage to be accessed in the white list with the WebView control list supported under the current operating environment so as to sequentially determine whether the applicable WebView controls exist in the WebView control list applicable to the APP. And if the WebView control exists, according to the arrangement sequence of the WebView controls in the WebView control list, determining the first WebView control successfully matched with the WebView control list supported under the current operating environment in the WebView control list applicable to the webpage to be accessed in the white list as the target WebView control for opening the webpage to be accessed. Otherwise, if the WebView controls in the WebView control lists applicable to the webpage to be accessed in the white list do not exist in the WebView control lists supported under the current operating environment, the first WebView control in the WebView control lists supported by the APP under the current operating environment can be directly selected to be determined as the target WebView control for opening the webpage to be accessed.
Secondly, if the white list does not have the URL of the webpage to be accessed, the WebView control applicable to the webpage to be accessed cannot be directly determined. Therefore, the embodiment matches the URL of the to-be-accessed webpage with the blacklist of the APP to determine whether the WebView control to which the to-be-accessed webpage is not applicable exists.
And if the URL of the webpage to be accessed exists in the blacklist, matching the WebView control list supported under the current operating environment with the WebView control list which is inapplicable to the webpage to be accessed in the blacklist, so as to sequentially determine whether the WebView control applicable to the APP exists in the blacklist. And if the WebView control applicable to the APP does not exist in the blacklist, selecting the first WebView control which is not matched with the blacklist in the WebView control list supported under the current operating environment, and directly determining the first WebView control as the target WebView control for opening the webpage to be accessed. And if the WebView control applicable to the APP exists in the blacklist, the WebView control is excluded. Further, if all WebView controls applicable to the APP exist in the blacklist, the webpage to be accessed is not displayed, or a blank page is displayed.
And finally, if the URL of the webpage to be accessed does not exist in the white list or the black list, directly selecting a first WebView control in the WebView control list supported under the current operating environment to determine the first WebView control as a target WebView control for opening the webpage to be accessed.
And 130, displaying and rendering the webpage to be accessed according to the target WebView control.
In the specific embodiment of the invention, the target WebView control is judged to be suitable for displaying the webpage to be accessed, so that the webpage to be accessed is directly displayed and rendered by using the target WebView control, and the normal display of the webpage to be accessed is ensured. The method and the device have the advantages that normal display of the same webpage is achieved according to different operating environments, integrity of display content of the webpage to be accessed and reasonability of layout of the display content are guaranteed, and abnormal display conditions such as incomplete display content or disordered layout are avoided.
The embodiment can also update the WebView control list associated with the uniform resource locator of the webpage to be accessed in the white list and/or the black list according to the display effect of the webpage to be accessed. Illustratively, when a certain webpage can be loaded and displayed most stably under the rendering of a certain WebView control, the WebView control can be added to a WebView control list associated with the URL of the webpage in a white list, so that the webpage can be displayed by preferentially using the WebView control; when a certain webpage has a serious abnormal condition under the rendering of a certain WebView control, the WebView control can be added to a WebView control list associated with the URL of the webpage in a blacklist so as to avoid displaying the webpage by using the WebView control again.
According to the technical scheme of the embodiment, before the webpage to be accessed is opened, the target WebView control for opening the webpage to be accessed is determined by acquiring the uniform resource locator of the webpage to be accessed and according to the uniform resource locator of the webpage to be accessed and the preset WebView control configuration information, so that the target WebView control is used for displaying and rendering the webpage to be accessed. According to the embodiment of the invention, the WebView control for loading the webpage to be accessed can be dynamically determined when the webpage is loaded by pre-configuring the configuration information of the WebView control, the WebView control which is more stable and more suitable for the webpage to be accessed is utilized to display and render the webpage to be accessed, a basis is provided for flexible switching of the WebView control when the webpage is abnormally loaded, and the display efficiency and performance of the webpage in the terminal are improved.
Example two
On the basis of the first embodiment, the present embodiment provides a preferred implementation of the web page display method, which can match applicable WebView controls. Fig. 2 is a flowchart of a web page display method according to a second embodiment of the present invention, and as shown in fig. 2, the method includes the following specific steps:
step 210, obtaining a uniform resource locator of a webpage to be accessed.
In the specific embodiment of the present invention, when the APP is started to perform web browsing, the start condition of the APP may be detected, so that a network request may be sent to the server in real time or at regular time when the APP is installed and used for the first time, when the APP is used for the first time after being updated, or in the use process of the user, so as to obtain the WebView control configuration information of the APP sent by the server. The WebView control configuration information comprises a white list, a black list and a WebView control list supported under the current operating environment; the white list and the black list are both configured with at least one uniform resource locator and a WebView control list associated with the at least one uniform resource locator. Therefore, when the user browses the webpage, the URL of the webpage to be accessed is obtained before the webpage to be accessed is opened.
And step 220, determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the preset WebView control configuration information.
In the embodiment of the present invention, a determination process of the target WebView control is shown in fig. 3. And according to the URL of the webpage to be accessed and the WebView control configuration information configured in advance in the terminal, matching the URL of the webpage to be accessed with a white list of an APP in the WebView control configuration information to determine whether the WebView control applicable to the webpage to be accessed exists. And if the WebView control applicable to the webpage to be accessed does not exist, matching the URL of the webpage to be accessed with the blacklist of the APP in the configuration information of the WebView control to determine whether the WebView control unsuitable for the webpage to be accessed exists. And finally, determining a target WebView control for opening a webpage to be accessed according to a matching result of the WebView control list associated with the URL successfully matched in the white list and the WebView control list supported by the APP in the WebView control configuration information under the current operating environment, or according to a matching result of the WebView control list supported by the APP in the WebView control configuration information under the current operating environment and the WebView control list associated with the URL successfully matched in the black list.
Specifically, at least five conditions for determining the target WebView control can be determined: in the first situation, a URL matched with the URL of the webpage to be accessed exists in a white list, and a WebView control in a WebView control list associated with the matched URL exists in a WebView control list supported under the current operating environment; case two: the white list has a URL matched with the URL of the webpage to be accessed, and the WebView control in the WebView control list associated with the matched URL does not exist in the WebView control list supported under the current operating environment; case three: the white list does not have a URL matched with the URL of the webpage to be accessed, but the black list has a URL matched with the URL of the webpage to be accessed, and the WebView control list associated with the matched URL in the black list has all or part of WebView controls in the WebView control list supported under the current operating environment; case four: the white list does not have a URL matched with the URL of the webpage to be accessed, but the black list has a URL matched with the URL of the webpage to be accessed, and the WebView control list associated with the matched URL in the black list does not have all WebView controls in the WebView control list supported under the current operating environment; case five: the white list does not have a URL matched with the URL of the webpage to be accessed, and the black list does not have a URL matched with the URL of the webpage to be accessed.
Optionally, if a uniform resource locator matched with the uniform resource locator of the web page to be accessed exists in the white list, acquiring a WebView control list associated with the matched uniform resource locator; respectively matching the WebView controls in the WebView control list associated with the matched uniform resource locators in the white list with the WebView controls in the WebView control list supported under the current operating environment; and if the WebView control matched with the WebView control in the WebView control list supported under the current operating environment exists in the white list, determining the matched WebView control in the white list as the target WebView control.
In this embodiment, first, the URL of the web page to be accessed is matched with the white list of the APP to determine whether a WebView control applicable to the web page to be accessed exists. And if the white list has the URL matched with the URL of the webpage to be accessed, namely the URL of the webpage to be accessed exists, acquiring a WebView control list associated with the matched URL in the white list. And matching the WebView control list associated with the matched URL in the white list with the WebView control list supported under the current operating environment, so as to sequentially determine whether the applicable WebView controls exist in the WebView control list applicable to the APP. If the WebView control list exists, namely, according to the arrangement sequence of the WebView controls in the WebView control list, determining the WebView control successfully matched with the WebView control list supported under the current operating environment in the first WebView control list associated with the matched URL in the white list as the target WebView control for opening the webpage to be accessed.
Optionally, if the white list does not have a uniform resource locator matched with the uniform resource locator of the web page to be accessed, matching the uniform resource locator of the web page to be accessed with the uniform resource locator in the black list; if the uniform resource locator matched with the uniform resource locator of the webpage to be accessed exists in the blacklist, acquiring a WebView control list associated with the matched uniform resource locator in the blacklist; respectively matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locators; and determining the WebView control which does not exist in the blacklist and is in the WebView control list supported under the current operating environment as the target WebView control.
In this embodiment, if the white list does not have a URL that matches the URL of the web page to be accessed, the URL of the web page to be accessed is matched with the black list of the APP to determine whether a WebView control that is not applicable to the web page to be accessed exists. And if the URL matched with the URL of the webpage to be accessed exists in the blacklist, namely the URL of the webpage to be accessed exists, acquiring a WebView control list associated with the matched URL in the blacklist. And matching the WebView control list supported in the current operating environment with the WebView control list associated with the matched URL in the blacklist, so as to sequentially determine whether the WebView control applicable to the APP exists in the blacklist. And if the part of the WebView control applicable to the APP exists in the blacklist, namely the third condition, excluding the existing WebView control, and selecting the first WebView control which is not matched with the blacklist in the WebView control list supported under the current operating environment to directly determine as the target WebView control for opening the webpage to be accessed.
Optionally, if all the WebView controls in the WebView control list supported in the current operating environment exist in the blacklist, loading and displaying the uniform resource locator of the web page to be accessed is prohibited.
In this embodiment, further, if all the WebView controls applicable to the APP itself exist in the blacklist, that is, in the special case of the above case three, the web page to be accessed is not displayed, or a blank page is displayed.
Optionally, if the white list or the black list does not have a WebView control matched with the WebView control in the WebView control list supported in the current operating environment, or if the black list does not have a uniform resource locator matched with the uniform resource locator of the web page to be accessed, determining any WebView control in the WebView control list supported in the current operating environment as the target WebView control.
In this embodiment, according to the matching sequence and logic, if the white list has the URL of the web page to be accessed, but the WebView controls in the WebView control list associated with the matched URL in the white list do not exist in the WebView control list supported in the current operating environment, that is, in the second case, any one of the WebView control lists supported by the APP in the current operating environment may be selected as the target WebView control. If the white list does not have the URL of the webpage to be accessed, the blacklist has the URL of the webpage to be accessed, but the WebView controls in the WebView control list supported in the current operating environment do not exist in the WebView control list associated with the matched URL in the blacklist, namely the WebView controls applicable to the APP do not exist in the blacklist, namely, under the condition of the fourth condition, any one of the WebView control lists supported by the APP in the current operating environment can be selected as the target WebView control. And if the URL of the webpage to be accessed does not exist in the white list or the black list, namely in the fifth case, selecting any one of the WebView control lists supported by the APP in the current operating environment as the target WebView control. And if the WebView controls are arranged in the various WebView control lists according to the display stability, a first WebView control in the WebView control list supported by the APP in the current operating environment can be selected and determined as a target WebView control for opening a webpage to be accessed.
For example, assume that in the WebView control configuration information, the white list is as follows:
{“http://www.abcd.com”:[WKWebView,X5WebView,AppleWebKit],
“http://www.abcde.com”:[TestWebView,XWebView]};
assume that in the WebView control configuration information, the blacklist is as follows:
{“http://www.1234.com”:[UIWebView,WKWebView,WebView],
“http://www.12345.com”:[UIWebView,WKWebView,X5WebView,AppleWebKit,WebView],
“http://www.123456.com”:[TestWebView,XWebView]};
in the configuration information of the WebView controls, a list of the WebView controls supported in the current operating environment is assumed as follows: [ UIWebView, WKWebView, X5WebView, AppleWebKit, WebView ].
And when the URL of the webpage to be accessed is http:// www.abcd.com, the white list has the URL matched with the URL of the webpage to be accessed. And sequentially matching the WebView controls in the WebView control list associated with the matched URL with the WebView control list supported under the current operating environment. And determining that the WKWebView is the target WebView control in the first WebView control list in the white list, wherein the first WebView control in the corresponding WebView control list in the white list is WKWebView and exists in the WebView control list supported under the current operating environment, namely the first situation.
When the URL of the webpage to be accessed is http:// www.abcde.com, the white list has the URL matched with the URL of the webpage to be accessed. And sequentially matching the WebView controls in the WebView control list associated with the matched URL with the WebView control list supported under the current operating environment. And determining a first WebView control, namely UIWebView, in the WebView control list supported under the current operating environment as a target WebView control for opening a webpage to be accessed.
When the URL of the webpage to be accessed is http:// www.1234.com, the white list does not have the URL matched with the URL of the webpage to be accessed, but the black list has the URL matched with the URL of the webpage to be accessed. And matching the WebView controls in the WebView control list supported in the current operating environment with the WebView control list associated with the matched URL in sequence. And if the first WebView control in the WebView control list supported in the current running environment is UIWebView and exists in the WebView control list associated with the matched URL in the blacklist, the use of the control UIWebView is excluded. And by analogy, the second WebView control in the WebView control list supported in the current operating environment is WKWebView, and exists in the WebView control list associated with the matched URL in the blacklist, and is excluded. And a third WebView control in the WebView control list supported under the current operating environment is X5WebView, but does not exist in the WebView control list associated with the matched URL in the blacklist, namely, the third situation, so that the X5WebView is determined to be the target WebView control.
When the URL of the webpage to be accessed is http:// www.12345.com, the white list does not have the URL matched with the URL of the webpage to be accessed, but the black list has the URL matched with the URL of the webpage to be accessed. And matching the WebView controls in the WebView control list supported in the current operating environment with the WebView control list associated with the matched URL in sequence. And the WebView controls in the WebView control list supported in the current operating environment all exist in the WebView control list associated with the matched URL in the blacklist, namely the special condition of the third condition, so that the webpage to be accessed is not displayed or a blank page is displayed.
When the URL of the webpage to be accessed is http:// www.123456.com, the white list does not have the URL matched with the URL of the webpage to be accessed, but the black list has the URL matched with the URL of the webpage to be accessed. And matching the WebView controls in the WebView control list supported in the current operating environment with the WebView control list associated with the matched URL in sequence. And determining the first WebView control, namely WebUIView, in the WebView control list supported in the current operating environment as a target WebView control for opening a webpage to be accessed, wherein all WebView controls in the WebView control list supported in the current operating environment do not exist in the WebView control list associated with the matched URL in the blacklist, namely the situation is four.
And when the URL of the webpage to be accessed is http:// www.xxxx.com, the white list does not have the URL matched with the URL of the webpage to be accessed, and the black list does not have the URL matched with the URL of the webpage to be accessed, namely the fifth case. Therefore, the first WebView control, namely UIWebView, in the WebView control list supported in the current running environment is determined as the target WebView control for opening the webpage to be accessed.
And 230, displaying and rendering the webpage to be accessed according to the target WebView control.
In the specific embodiment of the invention, the target WebView control is judged to be suitable for displaying the webpage to be accessed, so that the webpage to be accessed is directly displayed and rendered by using the target WebView control, and the normal display of the webpage to be accessed is ensured. The method and the device have the advantages that normal display of the same webpage is achieved according to different operating environments, integrity of display content of the webpage to be accessed and reasonability of layout of the display content are guaranteed, and abnormal display conditions such as incomplete display content or disordered layout are avoided.
And 240, updating the WebView control list associated with the uniform resource locator of the webpage to be accessed in the white list and/or the black list according to the display effect of the webpage to be accessed.
In the specific embodiment of the invention, when a certain webpage can be loaded and displayed most stably under the rendering of a certain WebView control, the WebView control can be added into a WebView control list associated with the URL of the webpage in a white list so as to display the webpage by preferentially using the WebView control; when a certain webpage has a serious abnormal condition under the rendering of a certain WebView control, the WebView control can be added to a WebView control list associated with the URL of the webpage in a blacklist so as to avoid displaying the webpage by using the WebView control again. And updating the WebView control list associated with the uniform resource locator of the webpage to be accessed in the white list and/or the black list.
According to the technical scheme of the embodiment, the WebView control configuration information of the APP in the current operating environment is obtained in advance through network communication with the server. Correspondingly, before the webpage to be accessed is opened, the URL of the webpage to be accessed is obtained, the URL and the control are matched according to the URL of the webpage to be accessed and the WebView control configuration information, a white list and a black list in the WebView control configuration information and a WebView control list supported under the current operating environment, the target WebView control for opening the webpage to be accessed is determined, and therefore the target WebView control is used for displaying and rendering the webpage to be accessed. According to the embodiment of the invention, the WebView control for loading the webpage to be accessed can be dynamically determined when the webpage is loaded by pre-configuring the configuration information of the WebView control so as to adapt to the current operating environment of the terminal, so that the WebView control which is more stable and more suitable for the webpage to be accessed is utilized to display and render the webpage to be accessed, a basis is provided for flexibly switching the WebView control when the webpage is abnormally loaded, and the display efficiency and performance of the webpage in the terminal are improved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a web page display device according to a third embodiment of the present invention, where this embodiment is applicable to displaying a web page, and the device can implement the web page display method according to any embodiment of the present invention. The device specifically includes:
a URL obtaining module 410, configured to obtain a uniform resource locator of a webpage to be accessed;
the target control determining module 420 is configured to determine a target WebView control for opening the web page to be accessed according to the uniform resource locator of the web page to be accessed and the pre-configured WebView control configuration information;
and the webpage display module 430 is configured to display and render the webpage to be accessed according to the target WebView control.
Optionally, the WebView control configuration information includes a white list, a black list, and a WebView control list supported in the current operating environment; and configuring at least one uniform resource locator and a WebView control list associated with the at least one uniform resource locator in the white list and the black list.
Optionally, the target control determining module 420 is specifically configured to:
if the white list has the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
respectively matching the WebView controls in the WebView control list associated with the matched uniform resource locators with the WebView controls in the WebView control list supported in the current operating environment;
and if the WebView control matched with the WebView control in the WebView control list supported in the current operating environment exists in the white list, determining the matched WebView control in the white list as a target WebView control.
Optionally, the target control determining module 420 is specifically configured to:
if the white list does not have the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, matching the uniform resource locator of the webpage to be accessed with the uniform resource locator in the black list;
if the blacklist has a uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locators;
and determining the WebView control in the WebView control list which is not in the blacklist and supported under the current operating environment as a target WebView control.
Optionally, the target control determining module 420 is specifically configured to:
and after the WebView controls in the WebView control list supported under the current operating environment are respectively matched with the WebView controls in the WebView control list associated with the matched uniform resource locators, if all the WebView controls in the WebView control list supported under the current operating environment exist in the blacklist, the loading and displaying of the uniform resource locators of the web page to be accessed are forbidden.
Optionally, if the white list or the black list does not have a WebView control matched with a WebView control in a WebView control list supported in the current operating environment, or if the black list does not have a uniform resource locator matched with a uniform resource locator of the web page to be accessed, determining any WebView control in the WebView control list supported in the current operating environment as a target WebView control.
Further, the apparatus further comprises a list updating module 440; the list updating module 440 is specifically configured to:
and after the webpage to be accessed is displayed and rendered according to the target WebView control, updating a WebView control list associated with the uniform resource locator of the webpage to be accessed in the white list and/or the black list according to the display effect of the webpage to be accessed.
According to the technical scheme of the embodiment, through the mutual cooperation of the functional modules, the functions of acquiring and updating the configuration information of the WebView control, acquiring the URL of the webpage to be accessed, matching the URL in the white list, matching the URL in the black list, matching the WebView control in the WebView control list supported under the current operating environment, determining the target WebView control, displaying and rendering the webpage to be accessed and the like are realized. According to the embodiment of the invention, the WebView control for loading the webpage to be accessed can be dynamically determined when the webpage is loaded by pre-configuring the configuration information of the WebView control, the WebView control which is more stable and more suitable for the webpage to be accessed is utilized to display and render the webpage to be accessed, a basis is provided for flexible switching of the WebView control when the webpage is abnormally loaded, and the display efficiency and performance of the webpage in the terminal are improved.
Example four
Fig. 5 is a schematic structural diagram of a terminal according to a fourth embodiment of the present invention. As shown in fig. 5, the terminal specifically includes: one or more processors 510, one processor 510 being illustrated in FIG. 5; the memory 520 is used for storing one or more programs, and when the one or more programs are executed by the one or more processors 510, the one or more processors 510 implement the web page display method according to any embodiment of the present invention. The processor 510 and the memory 520 may be connected by a bus or other means, such as the bus connection shown in FIG. 5.
The memory 520, which is a computer-readable storage medium, can be used for storing software programs, computer-executable programs, and modules, such as program instructions corresponding to the web page display method in the embodiment of the present invention (for example, the acquisition and update of the configuration information of the WebView control, the determination of the target WebView control, and the loading of the web page). The processor 510 executes various functional applications of the terminal and data processing by executing software programs, instructions, and modules stored in the memory 520, thereby implementing the above-described web page display method.
The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 520 may further include memory located remotely from the processor 510, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as computer-executable instructions) is stored, where the computer program is used for executing a method for displaying a web page when executed by a processor, and the method includes:
acquiring a uniform resource locator of a webpage to be accessed;
determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information;
and displaying and rendering the webpage to be accessed according to the target WebView control.
Of course, the computer-readable storage medium provided in the embodiments of the present invention has computer-executable instructions that are not limited to the method operations described above, and may also perform related operations in the web page display method provided in any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the embodiments of the present invention can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better implementation in many cases. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device) execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (5)

1. A method for displaying a web page, comprising:
acquiring a uniform resource locator of a webpage to be accessed;
determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information;
displaying and rendering the webpage to be accessed according to the target WebView control;
the WebView control configuration information comprises a white list, a black list and a WebView control list supported under the current operating environment;
the white list and the black list are both configured with at least one uniform resource locator and a WebView control list associated with the at least one uniform resource locator;
the step of determining to open a target WebView control of the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information comprises the following steps:
if the white list has the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
respectively matching the WebView controls in the WebView control list associated with the matched uniform resource locators with the WebView controls in the WebView control list supported in the current operating environment;
if the WebView control matched with the WebView control in the WebView control list supported by the current operating environment exists in the white list, determining the matched WebView control in the white list as a target WebView control;
the step of determining to open a target WebView control of the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the pre-configured WebView control configuration information comprises the following steps:
if the white list does not have the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, matching the uniform resource locator of the webpage to be accessed with the uniform resource locator in the black list;
if the blacklist has a uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locators;
determining the WebView control in the WebView control list which is not in the blacklist and supported under the current operating environment as a target WebView control;
after the step of respectively matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locator, the method further comprises the following steps:
if all WebView controls in the WebView control list supported in the current operating environment exist in the blacklist, prohibiting loading and displaying a uniform resource locator of the webpage to be accessed;
and if the white list or the black list does not have a WebView control matched with the WebView control in the WebView control list supported under the current operating environment, or if the black list does not have a uniform resource locator matched with the uniform resource locator of the webpage to be accessed, determining any WebView control in the WebView control list supported under the current operating environment as a target WebView control.
2. The method of claim 1, after the displaying and rendering the web page to be accessed according to the target WebView control, further comprising:
and updating the WebView control list associated with the uniform resource locator of the webpage to be accessed in the white list and/or the black list according to the display effect of the webpage to be accessed.
3. A web page display apparatus, comprising:
the URL acquisition module is used for acquiring a uniform resource locator of a webpage to be accessed;
the target control determining module is used for determining a target WebView control for opening the webpage to be accessed according to the uniform resource locator of the webpage to be accessed and the preset WebView control configuration information;
the webpage display module is used for displaying and rendering the webpage to be accessed according to the target WebView control;
the WebView control configuration information comprises:
the method comprises the steps of obtaining a white list, a black list and a WebView control list supported under the current operating environment;
the white list and the black list are both configured with at least one uniform resource locator and a WebView control list associated with the at least one uniform resource locator;
the target control determination module is further to:
if the white list has the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
respectively matching the WebView controls in the WebView control list associated with the matched uniform resource locators with the WebView controls in the WebView control list supported in the current operating environment;
if the WebView control matched with the WebView control in the WebView control list supported by the current operating environment exists in the white list, determining the matched WebView control in the white list as a target WebView control;
the target control determination module is further to:
if the white list does not have the uniform resource locator matched with the uniform resource locator of the webpage to be accessed, matching the uniform resource locator of the webpage to be accessed with the uniform resource locator in the black list;
if the blacklist has a uniform resource locator matched with the uniform resource locator of the webpage to be accessed, acquiring a WebView control list associated with the matched uniform resource locator;
matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locators;
determining the WebView control in the WebView control list which is not in the blacklist and supported under the current operating environment as a target WebView control;
the target control determination module is further to:
after the step of respectively matching the WebView controls in the WebView control list supported in the current operating environment with the WebView controls in the WebView control list associated with the matched uniform resource locator, the method further comprises the following steps:
if all WebView controls in the WebView control list supported in the current operating environment exist in the blacklist, prohibiting loading and displaying a uniform resource locator of the webpage to be accessed;
and if the white list or the black list does not have a WebView control matched with the WebView control in the WebView control list supported under the current operating environment, or if the black list does not have a uniform resource locator matched with the uniform resource locator of the webpage to be accessed, determining any WebView control in the WebView control list supported under the current operating environment as a target WebView control.
4. A web page display terminal, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the web page display method of any one of claims 1-2.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a web page display method according to any one of claims 1-2.
CN201811415503.XA 2018-11-26 2018-11-26 Webpage display method, device, terminal and storage medium Active CN109522500B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811415503.XA CN109522500B (en) 2018-11-26 2018-11-26 Webpage display method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811415503.XA CN109522500B (en) 2018-11-26 2018-11-26 Webpage display method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN109522500A CN109522500A (en) 2019-03-26
CN109522500B true CN109522500B (en) 2021-03-09

Family

ID=65793364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811415503.XA Active CN109522500B (en) 2018-11-26 2018-11-26 Webpage display method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN109522500B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209973B (en) * 2019-05-24 2021-03-19 厦门美柚股份有限公司 Webpage game loading method and device
CN110442286B (en) * 2019-07-29 2021-11-05 北京奇艺世纪科技有限公司 Page display method and device and electronic equipment
CN110929205A (en) * 2019-11-13 2020-03-27 贝壳技术有限公司 Method and device for loading control in webpage
CN112035188A (en) * 2020-09-28 2020-12-04 中移(杭州)信息技术有限公司 Control generation method and device, network equipment and storage medium
CN115470423B (en) * 2022-11-15 2023-03-24 深圳市乐凡信息科技有限公司 Android system updating method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973635A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Page access control method, and related device and system
CN107025583A (en) * 2016-01-29 2017-08-08 阿里巴巴集团控股有限公司 A kind of rendering intent of page control, equipment and terminal device
CN107066631A (en) * 2017-05-26 2017-08-18 北京三快在线科技有限公司 Display methods, device and the electronic equipment of the page
CN107423365A (en) * 2017-06-28 2017-12-01 努比亚技术有限公司 Web access method, terminal and computer-readable recording medium
CN107968769A (en) * 2016-10-19 2018-04-27 中兴通讯股份有限公司 Webpage security detection method and device
CN108052365A (en) * 2017-12-19 2018-05-18 深圳市四格互联信息技术有限公司 The component generation method and device of user interface
CN108846131A (en) * 2018-07-03 2018-11-20 深圳鼎盛电脑科技有限公司 Weex page rendering method, apparatus, terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9525716B2 (en) * 2012-02-27 2016-12-20 Disney Enterprises, Inc. Ensuring availability and parameter format of URL scheme commands
US10540168B2 (en) * 2017-05-01 2020-01-21 Apptimize Llc Mobile application webview modification
CN108845800B (en) * 2018-05-23 2022-05-31 北京五八信息技术有限公司 Method, device, equipment and storage medium for realizing component extension function

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973635A (en) * 2013-01-24 2014-08-06 腾讯科技(深圳)有限公司 Page access control method, and related device and system
CN107025583A (en) * 2016-01-29 2017-08-08 阿里巴巴集团控股有限公司 A kind of rendering intent of page control, equipment and terminal device
CN107968769A (en) * 2016-10-19 2018-04-27 中兴通讯股份有限公司 Webpage security detection method and device
CN107066631A (en) * 2017-05-26 2017-08-18 北京三快在线科技有限公司 Display methods, device and the electronic equipment of the page
CN107423365A (en) * 2017-06-28 2017-12-01 努比亚技术有限公司 Web access method, terminal and computer-readable recording medium
CN108052365A (en) * 2017-12-19 2018-05-18 深圳市四格互联信息技术有限公司 The component generation method and device of user interface
CN108846131A (en) * 2018-07-03 2018-11-20 深圳鼎盛电脑科技有限公司 Weex page rendering method, apparatus, terminal and storage medium

Also Published As

Publication number Publication date
CN109522500A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109522500B (en) Webpage display method, device, terminal and storage medium
US10699061B2 (en) Application page quick access
CN110221872B (en) Page jump method and device, electronic equipment and storage medium
CN110263275B (en) Method and device for accessing webpage, mobile terminal and storage medium
TWI690812B (en) Method, device and client for dynamic layout of page elements
US9584612B2 (en) Systems and methods for pushing applications
US10733259B2 (en) Web page access method and apparatus
CN106598972B (en) Information display method and device and intelligent terminal
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN110020323B (en) Page switching method and system for hybrid application, computer equipment and storage medium
US9727354B2 (en) System and methods for loading an application and its modules in a client device
US20140244812A1 (en) Method, system and program for browser to switch ie core
CN107291759B (en) Method and device for processing browser page resources
US11553035B2 (en) Cross-platform module for loading across a plurality of device types
US9325717B1 (en) Web-store restriction of external libraries
WO2016177341A1 (en) Interface calling method and device, and terminal
CN110941779B (en) Page loading method and device, storage medium and electronic equipment
US20190205546A1 (en) Web page processing method and apparatus, and storage medium
CN109325192B (en) Advertisement anti-shielding method and device
JP5753302B1 (en) Program, method and system for warning access to web page
CN105354490A (en) Method and device for processing hijacked browser
CN108268298B (en) Desktop icon generation method and device, storage medium and electronic equipment
CN110895592B (en) Link starting method, device, equipment and medium on mobile terminal
CN112433741A (en) Page processing method, device and system, electronic equipment and storage medium
CN111181836A (en) Message pushing method and device

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