Webpage content display method and device and computer program product
By injecting extract scripts and rendering scripts into the browser, extracting and rendering web page content and simulating user access, the problem of slow web page response speed is solved, achieving faster web page loading time and better user experience.
Patent Information
- Application Number
- CN202411082235.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, the response speed of web page content display is slow, and users need to enter access operations to trigger the browser to send a request to the server and display the web page content.
By injecting the extract script to the web page to be displayed, extracting the web page content and the URL of the associated web page, and simulating user access in the rendering script, requesting the associated web page from the server in advance, so as to directly render the web page content during actual access, reducing response delay.
It improves the response rate of web pages, reduces the loading time of web pages, and improves the browsing experience of users.
Smart Images

Figure CN119089063A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a web page content display method, device and computer program product. Background Art
[0002] With the development of Internet technology, the Internet has become the main source of information for users. At present, when users obtain web page content through browsers, they need to input access operations for the requested web page to trigger the browser to send a web page request to the server, and the browser parses the web page response from the server and displays the corresponding web page content. However, this web page content display method has the problem of slow response speed. Summary of the invention
[0003] The embodiments of the present application are intended to provide a method, device and computer program product for displaying web page content.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, a method for displaying webpage content is provided, comprising:
[0006] Injecting an extraction script into the web page to be displayed, and extracting the web page content of the web page to be displayed and the Uniform Resource Locator (URL) of the web page associated with the web page to be displayed through the extraction script;
[0007] Rendering the webpage content of the webpage to be displayed on the display interface through a rendering script, and requesting the associated webpage from a server according to the URL of the associated webpage;
[0008] The associated web page is used as the next web page to be displayed.
[0009] In a second aspect, a web page content display device is provided, comprising: a processor and a memory configured to store a computer program that can be run on the processor,
[0010] Wherein, the processor is configured to execute the steps of the aforementioned method when running the computer program.
[0011] According to a third aspect, a computer program product is provided, comprising computer program instructions, and when the computer program is executed by a processor, the steps of the aforementioned method are implemented.
[0012] In an embodiment of the present application, a web page content display method, device and computer program product are provided. The method may include: injecting an extraction script into a web page to be displayed, and extracting the web page content of the web page to be displayed and the URL of the associated web page of the web page to be displayed through the extraction script; in the process of rendering the web page content of the web page to be displayed on the display interface through the rendering script, simulating the user's access operation to the associated web page, and requesting the associated web page from the server in advance according to the URL of the associated web page; taking the associated web page as the next web page to be displayed, and continuing to inject the extraction script to extract the web page content of the associated web page, so that when an actual access operation to the associated web page is detected, the web page content of the associated web page can be directly rendered through the rendering script, thereby reducing the web page response delay and improving the web page response rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 This is a schematic diagram of a first process of a method for displaying webpage content in an embodiment of the present application;
[0014] Figure 2 This is a flow chart of a novel type web page detection method in an embodiment of the present application;
[0015] Figure 3 This is a second flow chart of the web page content display method in an embodiment of the present application;
[0016] Figure 4 This is a schematic diagram of a third process of the webpage content display method in an embodiment of the present application;
[0017] Figure 5 This is a schematic diagram of the composition structure of the web page content display device in the embodiment of the present application;
[0018] Figure 6 Schematic diagram of the composition structure of the web page content display device in the embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0020] The embodiment of the present application provides a web page content display method, which can be specifically a web page content display method based on a browser kernel. The browser kernel injects an extraction script into the web page to be displayed, and extracts the web page content of the web page to be displayed and the URL of the associated web page of the web page to be displayed through the extraction script; in the process of rendering the web page content of the web page to be displayed on the display interface through the rendering script, the user's access operation to the associated web page is simulated, and the associated web page is requested from the server in advance according to the URL of the associated web page; the associated web page is used as the next web page to be displayed, and the extraction script is continuously injected to extract the web page content of the associated web page. In this way, when the actual access operation to the associated web page is detected, the web page content of the associated web page can be directly rendered through the rendering script, thereby reducing the web page response delay and improving the web page response rate.
[0021] Figure 1 Schematic diagram of the first process of the web page content display method in the embodiment of the present application. Figure 1 As shown, the method may specifically include:
[0022] Step 101: injecting an extraction script into the web page to be displayed, and extracting the web page content of the web page to be displayed and the uniform resource locator URL of the web page associated with the web page to be displayed through the extraction script;
[0023] The web page to be displayed may be the web page to be displayed on the client display interface and / or the web page being displayed. The web pages associated with the web page to be displayed generally refer to other web pages that are directly or indirectly related to the web page to be displayed in terms of content, subject, link or other means. These associated web pages may include: other web pages directly pointed to by hyperlinks within the web page to be displayed, web pages referenced and referenced by the web page to be displayed, and other web pages under the same website, especially web pages located in the same directory or having a similar path structure as the web page to be displayed.
[0024] The extraction script is used to extract the web page content of the web page to be displayed, as well as the URL of the web page associated with the web page to be displayed. The extraction script can be a plug-in extraction script provided by the front-end javascript side. Plug-in is a technology that configures the web page extraction function as an independent, reusable functional module or plug-in, so that the extraction script can be dynamically injected into any web page according to business needs, thereby realizing flexible expansion and dynamic update of the web page extraction function.
[0025] In some embodiments, the front-end javascript side provides an extraction script to the browser kernel. After loading the web page, the browser kernel injects the extraction script into the web page to extract the web page content and the URL of the associated web page; the front-end extraction script returns the web page content of the web page to be displayed and the URL of the associated web page to the browser kernel, and the browser kernel stores the web page content to respond to the access operation of the web page; the browser kernel pre-requests the associated web page from the server according to the URL of the associated web page to improve the web page response rate.
[0026] In some embodiments, the extraction script is also used to filter out the first content of the web page to be displayed. The first content can be understood as content that is not wanted to be displayed to the user, and the web page content display is optimized by filtering out the first content. The first content may include: advertisements, dangerous links, prohibited links or other specific content.
[0027] In some embodiments, the method further includes: when a trigger condition that allows the web page to be displayed to enter a web page reading mode is met, injecting an extraction script into the web page to be displayed.
[0028] The webpage reading mode can be understood as an immersive webpage browsing mode. In this mode, a specific webpage layout is used to display webpages, the display effect is optimized, and the webpage response speed is high, which improves the user's webpage browsing experience. When the triggering conditions for the webpage to be displayed to allow the webpage reading mode are met, the extraction script will be injected into the webpage to be displayed to extract the webpage content and perform subsequent operations.
[0029] In some embodiments, the method further includes: when the triggering condition for the web page to be displayed to allow entering the web page reading mode is not satisfied, displaying the web page to be displayed using the original web page display method, or prohibiting the display.
[0030] In some embodiments, the method further includes: if the triggering condition for the web page to be displayed to enter the web page reading mode is not satisfied, prohibiting the display. Exemplarily, a prohibition mark may be displayed for a web page in the web page blacklist to prompt the user browser to prohibit the access operation of the web page to be displayed.
[0031] In some embodiments, the triggering conditions for allowing entry into the web page reading mode include at least one of the following: the first web page identifier of the web page to be displayed does not match the first web page identifier in the web page blacklist, and the web page blacklist includes at least one first web page identifier; the second web page identifier of the web page to be displayed matches the second web page identifier in the web page whitelist, and the web page whitelist includes at least one second web page identifier; the web page reading mode is enabled.
[0032] The webpage blacklist is configured with at least one webpage that prohibits the use of the webpage reading mode. The webpage blacklist can be flexibly configured to prohibit the use of the webpage reading mode provided in the embodiment of the present application. Exemplarily, the first webpage identifier may include at least one of the following: webpage identifiers such as webpage URL, domain name, and IP address.
[0033] The webpage whitelist is configured with at least one webpage that allows the use of the webpage reading mode. The webpage whitelist can be flexibly configured to allow the use of the webpage reading mode provided by the embodiment of the present application. Exemplarily, the second webpage identifier may include at least one of the following: webpage identifiers such as a webpage URL, a domain name, and an IP address. The first webpage identifier and the second webpage identifier may be the same or different.
[0034] By adding a control switch for web reading mode in the settings interface, users can choose to turn on or off the web reading mode.
[0035] In some embodiments, the method may further include: determining to obtain the URL of the web page to be displayed according to the web page access information input by the user, and requesting the corresponding web page from the server according to the URL of the web page to be displayed. Exemplarily, when a user accesses a web page through a browser, the user first enters the domain name of the website to be accessed in the address bar of the browser; the IP address of the website is determined through domain name resolution; the browser initiates a TCP connection request to the target server according to the IP address; the browser sends an HTTP request containing the URL to the target server through the TCP connection, and receives an HTTP response containing web page information.
[0036] That is to say, before entering the webpage reading mode, the browser kernel has not cached the webpage content of the webpage to be displayed, and needs to first determine the URL of the webpage to be displayed according to the webpage access information input by the user, and then request the corresponding webpage from the server according to the URL of the webpage to be displayed. After entering the webpage reading mode, the browser kernel simulates the user's access operation to the associated webpage, and requests the associated webpage from the server in advance according to the URL of the associated webpage.
[0037] In some embodiments, the method may further include: in response to a bookmarking operation for a web page to be displayed, adding identification information of the web page to be displayed to a bookmark list, and storing web page content of the web page to be displayed and a URL of a web page associated with the web page to be displayed.
[0038] Furthermore, in response to an access operation to a web page to be displayed in the bookmark list, specific web page content of the web page to be displayed and a URL of a web page associated with the web page to be displayed are obtained from the storage unit.
[0039] For example, when the web page to be displayed is a novel type web page, the current novel can be added to the bookshelf, and the bookshelf web page displays the cover of the current novel and stores the text content of the current chapter of the current novel and the URL of the adjacent chapter. If the user enters from the bookshelf next time and clicks on the novel, the text content of the current chapter can be directly obtained from the storage unit for display, and the corresponding text content can be pre-requested according to the URL of the adjacent chapter.
[0040] Exemplarily, the web pages to be displayed may also be web pages frequently visited by users, such as blogs, forums, and social media. These web pages can be added to a bookmark list, and can be quickly accessed from the bookmark list the next time these web pages are visited.
[0041] Step 102: Rendering the webpage content of the webpage to be displayed on the display interface through a rendering script, and requesting the associated webpage from the server according to the URL of the associated webpage;
[0042] The rendering script is used to render (display) the webpage content of the webpage to be displayed on the display interface. The extraction script can be a plug-in rendering script provided by the front-end javascript side.
[0043] In some embodiments, the browser client creates a rendering webview, the front-end javascript side provides a rendering script to inject into the webview, the rendering script receives the webpage content delivered by the browser kernel, and renders the webpage content on the webview to realize the display of the webpage content. The webview is mainly used to embed and display web pages inside the application. Through the webview, complex web applications or dynamic content can be easily integrated into the application, thereby improving the user experience and application flexibility.
[0044] In some embodiments, the method may further include: adding second content to the web page to be displayed or the associated web page through a rendering script. The second content may be understood as content that the browser additionally displays to the user, and the web page content display is optimized by adding the second content. The second content may include: public service advertisements, commercial advertisements, other specific content, etc.
[0045] In some embodiments, the method further includes: in response to an access operation to the web page to be displayed, rendering web page content of the web page to be displayed on the display interface through a rendering script.
[0046] Exemplarily, the access operation of the web page to be displayed may be a user's clicking operation on a specific button or hyperlink, a page turning operation, or a directory selection operation.
[0047] In some embodiments, the method may further include: judging whether the web page to be displayed is a preset type of web page based on the web page content and URL of the web page to be displayed; when it is determined that the web page to be displayed is a preset type of web page, rendering the web page content of the web page to be displayed on the display interface through a rendering script, and requesting an associated web page from the server based on the URL of the associated web page.
[0048] In some embodiments, the extraction script is also used to detect whether the web page to be displayed is a preset type of web page. That is, the extraction script determines whether the web page to be displayed is a preset type of web page based on the web page content and URL of the web page to be displayed. When it is determined that the web page to be displayed is a preset type of web page, it is determined that the web page to be displayed enters the web page reading mode. In other words, the extraction script integrates web page content extraction capability and web page detection capability. The extraction script first extracts web page content and URL, and then uses the web page content and URL as influencing factors for determining whether the web page to be displayed is a preset type of web page to obtain a detection result.
[0049] In some embodiments, the front-end javascript side may also provide a plug-in detection script, which determines whether the web page to be displayed is a preset type of web page based on the web page content and URL of the web page to be displayed.
[0050] Exemplarily, taking the preset type of web page as a novel type web page as an example, judging whether the web page to be displayed is a preset type web page based on the web page content and URL of the web page to be displayed includes: analyzing the web page content of the web page to be displayed to determine the text features of the web page to be displayed; determining the URL similarity between the web page to be displayed and the novel type web page based on the URL of the web page to be displayed and the URL features of the novel type web page; determining whether the web page to be displayed is a novel type web page based on the text features of the web page to be displayed and the URL similarity.
[0051] Figure 2 FIG. 1 is a flow chart of a novel type web page detection method in an embodiment of the present application. Figure 2 As shown, the novel type web page detection method may include:
[0052] Step 201: Obtain the webpage content and URL of the webpage to be displayed;
[0053] Step 203: text feature check, URL similarity matching;
[0054] The algorithm for checking whether the web page to be displayed is a novel type web page usually relies on analyzing the content, structure, metadata and URL of the web page.
[0055] For example, novel web pages usually contain a large amount of text content. The proportion of plain text (after removing HTML tags) in the web page and the total length of the text can be calculated. If the web page to be displayed has a high text density and a long text length, it can be inferred that the web page to be displayed may be a novel type web page.
[0056] Paragraphs and chapters: Novel web pages often contain multiple paragraphs, and may be separated by specific HTML tags (such as <h1>,< / h1> <h2>) to mark the chapter titles. The number and distribution of these tags can be detected to assist in judgment.
[0057] Keyword matching: Build a keyword library for novels (such as "Chapter 1", "Section X", "Author", "Copyright", etc.), and search for these keywords in the web page content. The presence of keywords can increase the possibility that the web page is a novel page.
[0058] URL similarity matching evaluates the similarity between two or more URLs by comparing specific features (such as domain names, paths, parameters, etc.).
[0059] Step 203: The text features and URL similarity of the web page to be displayed satisfy the features of a novel-type web page, and the web page to be displayed is determined to be a novel-type web page.
[0060] In some embodiments, the method may further include: when it is determined that the web page to be displayed is a preset type of web page, rendering a prompt button for entering the web page reading mode on the display interface through a rendering script; in response to a click operation on the prompt button for entering the web page reading mode, rendering the web page content of the web page to be displayed on the display interface through a rendering script, and requesting an associated web page from the server based on the URL of the associated web page.
[0061] In some embodiments, when it is determined that the web page to be displayed is a preset type of web page, a prompt button for exiting the web page reading mode is rendered on the display interface through a rendering script; in response to a click operation on the prompt button for exiting the web page reading mode, the web page reading mode is exited.
[0062] In some embodiments, rendering the web page content of the web page to be displayed on the display interface through a rendering script, and requesting an associated web page from the server according to the URL of the associated web page, can include: monitoring the rendering progress of the web page content of the web page to be displayed during the process of rendering the web page content of the web page to be displayed on the display interface through a rendering script; when the rendering progress is greater than or equal to a specific threshold, triggering a request to the server for an associated web page according to the URL of the associated web page.
[0063] In actual applications, the operation of requesting the associated web page can be triggered at any time during the rendering process of the rendering script. However, in order to avoid the webpage content of the associated webpage occupying the browser storage unit for a long time, the rendering progress of the current webpage to be displayed can be monitored to trigger the operation of requesting the associated webpage at an appropriate time, that is, to avoid occupying storage resources for a long time, and to respond to the access operation of the associated webpage in a timely manner.
[0064] The rendering progress of the webpage content can also be understood as the amount of webpage content displayed. For example, if 80% of the current webpage content has been rendered on the display interface, it means that the user is about to finish reading the current webpage content, and then the operation of requesting the associated webpage is triggered.
[0065] Step 103: Use the associated web page as the next web page to be displayed.
[0066] That is to say, in the process of rendering the web page content of the web page to be displayed on the display interface through the rendering script, the user's access operation to the associated web page is simulated, and the associated web page is requested from the server in advance according to the URL of the associated web page; the associated web page is taken as the next web page to be displayed, and the extraction script is continued to be injected to extract the web page content of the associated web page. In this way, when the actual access operation to the associated web page is detected, the web page content of the associated web page can be directly rendered through the rendering script, thereby reducing the web page response delay and improving the web page response rate.
[0067] Figure 3 Schematic diagram of the second process of the web page content display method in the embodiment of the present application. Figure 3 As shown, the method may specifically include:
[0068] Step 301: Determine and obtain the URL of the web page to be displayed according to the web page access information input by the user;
[0069] Step 302: Requesting the web page to be displayed from the server according to the URL of the web page to be displayed;
[0070] Step 303: injecting an extraction script into the web page to be displayed, and extracting the web page content of the web page to be displayed and the URL of the web page associated with the web page to be displayed through the extraction script;
[0071] Step 304: Rendering the webpage content of the webpage to be displayed on the display interface through the rendering script, and monitoring the rendering progress of the webpage content of the webpage to be displayed;
[0072] In some embodiments, the method further includes: storing web page content of the web page to be displayed.
[0073] Correspondingly, in response to the access operation to the web page to be displayed, the web page content of the web page to be displayed is obtained from the storage unit, and the web page content of the web page to be displayed is rendered on the display interface through the rendering script.
[0074] Step 305: Determine whether the rendering progress is greater than or equal to a specific threshold; if yes, execute step 306; if no, return to step 304;
[0075] Step 306: Request the server for the associated web page according to the URL of the associated web page
[0076] Step 307: Use the associated web page as the next web page to be displayed, and return to step 301 to continue executing the web page content display method provided in the embodiment of the present application.
[0077] The embodiment of the present application takes the display of a novel-type web page as an example to further illustrate the web page content display method provided in the embodiment of the present application.
[0078] Figure 4 Schematic diagram of the third process of the web page content display method in the embodiment of the present application. Figure 4 As shown, the method may specifically include:
[0079] Step 401: The browser kernel loads the web page;
[0080] For novel type web pages, according to the user's choice of reading novels and chapters, the URL for reading chapters is determined; and according to the URL for reading chapters, the web page of the chapter is loaded from the server side.
[0081] Step 402: The browser kernel reads the configuration file of the web page whitelist;
[0082] Step 403: Determine whether the web page to be displayed is in the web page whitelist; if yes, execute step 404; if not, end.
[0083] The configuration file includes at least one second web page identifier. The browser kernel matches the second web page identifier of the web page to be displayed with the second web page identifier in the configuration file. If it matches any second web page identifier in the configuration file, it is determined that the web page to be displayed is in the web page whitelist. If it does not match all second web page identifiers in the configuration file, it is determined that the web page to be displayed is outside the web page whitelist.
[0084] Exemplarily, the second web page identifier may include a web page domain name.
[0085] Step 404: The browser kernel injects the extraction script into the web page;
[0086] Step 405: Execute webpage content extraction and determine whether the content extraction is successful. If yes, obtain the extraction result and execute step 406; if no, end;
[0087] In some embodiments, the extraction result includes the text content of the current web page and the URL of the web page associated with the current web page.
[0088] In some embodiments, the extraction result also includes the URL of the current web page.
[0089] Step 406: Based on the novel type webpage detection algorithm, determine whether the current webpage is a novel type webpage; if yes, execute step 407; if no, end;
[0090] In some embodiments, the novel type web page detection algorithm includes: determining whether the current web page is a novel type web page based on text density and URL similarity.
[0091] In some embodiments, for a novel type web page, the extraction result includes the novel text content of the current web page, and the URL of the associated chapter of the current chapter, and the associated chapter includes one or more associated chapters in the current novel directory. Exemplarily, the associated chapter includes the next chapter, and / or the next chapter.
[0092] In some embodiments, if the browser has not entered the web page reading mode, the method may further include: the display interface of the browser client displays a prompt button for entering the web page reading mode; detecting that the user clicks the prompt button for entering the web page reading mode, and entering the web page reading mode.
[0093] In some embodiments, if the browser has entered the web page reading mode, the method may further include: the display interface of the browser client displays a prompt button to exit the web page reading mode; detecting that the user clicks the prompt button to exit the web page reading mode, and exiting the web page reading mode.
[0094] Step 407: The browser client creates a rendering webview and injects a rendering script;
[0095] Step 408: Determine whether to enter from the bookshelf; if yes, execute step 409; if no, execute step 410;
[0096] Step 409: Read the reading progress, and obtain the webpage content of the current chapter and the URL of the associated chapter of the current chapter from the storage unit;
[0097] Exemplarily, the associated chapters include the next chapter and the previous chapter of the current chapter.
[0098] Step 410: Obtaining the extraction result of the extraction script;
[0099] Step 411: The web page content of the current chapter is passed to the rendering script, and the rendering script renders the web page content of the current chapter on the webview.
[0100] Step 412: The browser kernel requests the associated chapter web page from the server according to the URL of the associated chapter; return to step 401.
[0101] The technical solution provided by the embodiments of the present application has the following beneficial effects:
[0102] 1. Combining the incompatibility of the browser kernel extraction algorithm and the front-end javascript extraction algorithm, the response speed of the novel web page is greatly improved;
[0103] 2. The front-end JavaScript side provides plug-in extraction scripts and rendering scripts to facilitate the update of extraction and rendering functions;
[0104] 3. Filter the web page content by extracting script filters, insert the web page content by rendering scripts, optimize the web page content display, and realize flexible configuration of web page content.
[0105] The browser described in this application can run on terminal devices such as mobile phones, personal computers, tablet computers, laptops, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, cameras, etc.
[0106] To implement the method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides a web page content display device, such as Figure 5 As shown, the web page content display device 50 includes:
[0107] The extraction unit 501 is used to inject an extraction script into the web page to be displayed, and extract the web page content of the web page to be displayed and the uniform resource locator URL of the web page associated with the web page to be displayed through the extraction script;
[0108] A rendering unit 502 is used to render the webpage content of the webpage to be displayed on the display interface through a rendering script;
[0109] The processing unit 503 is used to request the associated web page from the server according to the URL of the associated web page, and use the associated web page as the next web page to be displayed.
[0110] In some embodiments, the extraction unit 501 is used to inject an extraction script into the web page to be displayed when a trigger condition that allows the web page to be displayed to enter the web page reading mode is met.
[0111] In some embodiments, the triggering condition for allowing entry into the web page reading mode includes at least one of the following:
[0112] The first webpage identifier of the webpage to be displayed does not match the first webpage identifier in the webpage blacklist, and the webpage blacklist includes at least one first webpage identifier;
[0113] The second webpage identifier of the webpage to be displayed matches the second webpage identifier in the webpage whitelist, and the webpage whitelist includes at least one second webpage identifier;
[0114] Web page reading mode is enabled.
[0115] In some embodiments, the extraction unit 501 is also used to determine whether the web page to be displayed is a preset type of web page based on the web page content of the web page to be displayed and the URL of the web page to be displayed; when it is determined that the web page to be displayed is a preset type of web page, the web page content of the web page to be displayed is rendered on the display interface through a rendering script, and an associated web page is requested from the server based on the URL of the associated web page.
[0116] In some embodiments, the preset type of web page is a novel type web page; the extraction unit 501 is specifically used to analyze the web page content of the web page to be displayed and determine the text features of the web page to be displayed; determine the URL similarity between the web page to be displayed and the novel type web page according to the URL of the web page to be displayed and the URL features of the novel type web page; determine whether the web page to be displayed is a novel type web page according to the text features and URL similarity of the web page to be displayed.
[0117] In some embodiments, when it is determined that the web page to be displayed is a preset type of web page, a prompt button for entering the web page reading mode is rendered on the display interface through a rendering script; in response to a click operation on the prompt button for entering the web page reading mode, the rendering unit 502 is triggered to execute the rendering of the web page content to be displayed on the display interface through the rendering script, and the processing unit 503 is triggered to request an associated web page from the server according to the URL of the associated web page.
[0118] In some embodiments, the rendering unit 502 is also used to monitor the rendering progress of the web page content of the web page to be displayed in the process of rendering the web page content of the web page to be displayed on the display interface through the rendering script; when the rendering progress is greater than or equal to a specific threshold, the processing unit 503 is triggered to request an associated web page from the server according to the URL of the associated web page.
[0119] In some embodiments, the web page content display device 50 further includes: a storage unit 504 for storing web page content to be displayed;
[0120] The rendering unit 502 is used to obtain the webpage content of the webpage to be displayed from the storage unit in response to the access operation to the webpage to be displayed, and render the webpage content of the webpage to be displayed on the display interface through the rendering script.
[0121] In some embodiments, the storage unit 504 is further used to add identification information of the web page to be displayed to the bookmark list in response to a bookmarking operation for the web page to be displayed, and store the web page content of the web page to be displayed and the URL of the associated web page of the web page to be displayed.
[0122] The extracting unit 501 is further configured to obtain, from the storage unit 504 , specific webpage content of the webpage to be displayed and the URL of the webpage associated with the webpage to be displayed in response to an access operation to the webpage to be displayed in the bookmark list.
[0123] In some embodiments, the extraction unit 501 is used to filter out the first content of the web page to be displayed or the associated web page by extracting the script;
[0124] and / or,
[0125] The rendering unit 502 is used to add the second content to the web page to be displayed or the associated web page through a rendering script.
[0126] In practical applications, the above device can be a terminal device or a chip applied to a terminal device. In the present application, the device can realize the functions of multiple units by software, hardware, or a combination of software and hardware, so that the device can execute the web page content display method provided in any of the above embodiments. The technical effects of each technical solution of the device can refer to the technical effects of the corresponding technical solution in the web page content display method, and this application will not repeat them one by one.
[0127] Based on the hardware implementation of each unit in the above web page content display device, the embodiment of the present application also provides a web page content display device, such as Figure 6 As shown, the web page content display device 60 includes: a processor 601 and a memory 602 configured to store a computer program that can be run on the processor;
[0128] The processor 601 is configured to execute the method steps in the aforementioned embodiment when running a computer program.
[0129] Of course, in practical applications, Figure 6 As shown, the various components in the webpage content display device 60 are coupled together via a bus system 603. It is understandable that the bus system 603 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 603 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as bus system 603 in the figure.
[0130] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present application do not specifically limit this.
[0131] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.
[0132] In some embodiments, the webpage content display device may be a chip, and the chip may further include an input interface, wherein the processor may control the input interface to communicate with other devices or chips, and specifically, may obtain information or data sent by other devices or chips.
[0133] Optionally, the chip may further include an output interface, wherein the processor may control the output interface to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.
[0134] Optionally, the chip can be applied to the terminal device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the terminal device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0135] In an exemplary embodiment, the embodiment of the present application further provides a computer-readable storage medium, such as a memory including a computer program, and the computer program can be executed by a processor of a web page content display device to complete the steps of the aforementioned method.
[0136] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the embodiments of the present application are implemented.
[0137] Optionally, the computer program product can be applied to the web page content display device in the embodiments of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the web page content display device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.
[0138] The embodiment of the present application also provides a computer program.
[0139] Optionally, the computer program may be applied to the web page content display device in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the web page content display device in the various methods of the embodiments of the present application. For the sake of brevity, they are not described here.
[0140] It should be understood that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0141] It should be understood that the terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. The expressions "have", "may have", "include" and "include", or "may include" and "may include" in this application can be used to indicate the presence of corresponding features (e.g., elements such as numerical values, functions, operations or components), but do not exclude the presence of additional features.
[0142] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and are not necessarily used to describe a specific order or sequence. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0143] The technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0144] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and equipment can be implemented in other ways. The embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0145] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0146] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0147] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.< / h2>
Claims
1. A web page content display method, characterized in that: The method comprises: Injecting an extraction script into the web page to be displayed, and extracting the web page content of the web page to be displayed and the uniform resource locator URL of the web page associated with the web page to be displayed through the extraction script; Rendering the webpage content of the webpage to be displayed on the display interface through a rendering script, and requesting the associated webpage from a server according to the URL of the associated webpage; The associated web page is used as the next web page to be displayed.
2. The method according to claim 1, characterized in that The method further comprises: In the case where a trigger condition is met, the injection of the extraction script into the web page to be displayed is executed, and the trigger condition includes at least one of the following: The first webpage identifier of the webpage to be displayed does not match the first webpage identifier in the webpage blacklist, and the webpage blacklist includes at least one of the first webpage identifiers; The second webpage identifier of the webpage to be displayed matches a second webpage identifier in a webpage whitelist, and the webpage whitelist includes at least one of the second webpage identifiers; The web page reading mode is enabled.
3. The method according to claim 1, characterized in that The method further comprises: Determining whether the webpage to be displayed is a webpage of a preset type according to the webpage content of the webpage to be displayed and the URL of the webpage to be displayed; When it is determined that the web page to be displayed is a web page of a preset type, the web page content of the web page to be displayed is rendered on the display interface through a rendering script, and the associated web page is requested from a server according to the URL of the associated web page.
4. The method according to claim 3, characterized in that The preset type of web page is a novel type web page; The step of determining whether the web page to be displayed is a web page of a preset type according to the web page content of the web page to be displayed and the URL of the web page to be displayed includes: Analyzing the webpage content of the webpage to be displayed to determine the text features of the webpage to be displayed; Determining the URL similarity between the web page to be displayed and the novel-type web page according to the URL characteristics of the web page to be displayed and the novel-type web page; According to the text features and URL similarity of the web page to be displayed, it is determined whether the web page to be displayed is a novel type web page.
5. The method according to claim 3, characterized in that: The method further comprises: When it is determined that the web page to be displayed is a web page of a preset type, rendering a prompt button for entering a web page reading mode on the display interface through the rendering script; In response to a click operation on the prompt button for entering the web page reading mode, the web page content of the web page to be displayed is rendered on the display interface through a rendering script, and the associated web page is requested from a server according to the URL of the associated web page.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In the process of rendering the webpage content of the webpage to be displayed on the display interface through the rendering script, monitoring the rendering progress of the webpage content of the webpage to be displayed; When the rendering progress is greater than or equal to a specific threshold, triggering a request for the associated web page to a server according to the URL of the associated web page.
7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Storing the webpage content of the webpage to be displayed; In response to an access operation to the web page to be displayed, the web page content of the web page to be displayed is obtained from a storage unit, and the web page content of the web page to be displayed is rendered on a display interface through the rendering script.
8. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to an operation of adding a bookmark to the web page to be displayed, adding identification information of the web page to be displayed to a bookmark list, and storing web page content of the web page to be displayed and a URL of a web page associated with the web page to be displayed; In response to an access operation to the web page to be displayed in the bookmark list, the web page content specific to the web page to be displayed and the URL of the web page associated with the web page to be displayed are acquired from a storage unit.
9. A web page content display device, characterized in that: The web page content display device comprises: a processor and a memory configured to store a computer program that can be run on the processor, Wherein, the processor is configured to execute the steps of the method according to any one of claims 1 to 8 when running the computer program.
10. A computer program product comprising computer program instructions, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
