A web page keyword positioning and retrieval method

By combining Chrome Extensions and search platform, using Chrome Extensions OpenApi and polling probes to interface with MutationObserver, the automated positioning and data interaction of web keywords is realized, solving the shortcomings of automated and efficient data interaction in the existing technology, and improving the efficiency and user experience of web information browsing.

CN115391633BActive Publication Date: 2025-05-16FOCUS TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210797999.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-06
Publication Date
2025-05-16
Estimated Expiration
2042-07-06

AI Technical Summary

Technical Problem

The existing technology cannot realize the automation and efficient data interaction of web information browsing, and the degree of function enrichment is low, which cannot meet the user's customized browsing needs.

Method used

By combining Chrome Extensions and search platform, Chrome Extensions OpenApi can achieve fast positioning and subsequent data interaction of specific keywords on web pages, and use the target node's polling probe and MutationObserver interface to monitor, automatically trigger the positioning and search operations, and re-render the web page.

Benefits of technology

It realizes that users can automatically complete web keyword positioning and data retrieval without manual triggering, improves web information browsing efficiency, expands user browsing experience, and solves the problem that the webRequest API is not supported in Chrome Extensions V3 engine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391633B_ABST
    Figure CN115391633B_ABST
Patent Text Reader

Abstract

The invention discloses a webpage keyword location retrieval method, which is characterized by configuring an extension module of Chrome Extensions, the extension module is connected to a search module through a polling probe and an interface monitor, dynamically loading and monitoring target webpage data, automatically locating and re-rendering the webpage; configuring a search module, communicating through an Http protocol, including a search service layer and a search platform, searching according to the parameters of the target webpage keyword transmitted by the extension module, and returning the search results to the extension module. It can achieve real-time page feedback of the target keyword search results, expand the user browsing experience; solve the problem of ChromeExtensions V3 engine webRequest not being supported; fully automated process, no need for manual triggering by the user, greatly improve productivity, decouple between modules, and replace the search platform according to actual business requirements and other beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of computer processing technology and WEB page processing, and in particular to a web page keyword positioning and retrieval method. Background Art

[0002] With the rapid development of network technology and information dissemination technology, web browsing has become an important way for people to obtain information in their daily lives. However, how to quickly and efficiently identify the information you need from the massive amount of web information and the varying quality of the information is the key to improving productivity.

[0003] Among existing public technologies, the official Chrome browser provides a keyword targeting extension and integrates it into its own browser product. However, the results of existing applications still fall far short of meeting the core requirements mentioned above. Its main shortcomings are as follows:

[0004] Unable to be automated: The keyword targeting feature provided by the Chrome browser can only be triggered manually by the user. This means that the user must enter the keywords to be targeted and manually trigger the webpage information targeting. When users browse the webpage frequently and extensively, repeated manual triggering will actually reduce browsing efficiency.

[0005] No data interaction: The keyword targeting feature provided by the Chrome browser is simply a targeting function, without any follow-up process. This cannot meet the user's subsequent data retrieval needs after keyword targeting, and the actual follow-up process still requires manual operation by the user.

[0006] Low level of enrichment: The keyword targeting function provided by the Chrome browser can only highlight the located keywords and cannot expand the page, thus failing to meet users' customized browsing needs.

[0007] Therefore, a webpage keyword positioning and retrieval method with better user experience is needed. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to overcome the deficiencies of the existing technology and provide a web page keyword positioning and retrieval method based on the collaboration of ChromeExtensions and search platforms. It is an innovative practice aimed at improving the efficiency of web page information browsing. The present invention includes two core parts: one is to rely on the ChromeExtensions OpenApi provided by Chrome to complete the rapid positioning of specific keywords on Chrome browser web pages and subsequent data interaction, web page re-rendering, etc.; the other is the rapid retrieval of data in specific business scenarios, and the search platform involved depends on the specific business. Through the combination of Chrome Extensions OpenApi and the mutual collaboration with the search platform, users can achieve the goal of re-rendering Chrome browser web pages by configuring customized positioning rules, thereby expanding the user browsing experience.

[0009] To solve the above technical problems, the present invention provides a webpage keyword location retrieval method, which is characterized by comprising the following steps:

[0010] Step 1: Configure the Chrome Extensions extension module. The extension module is connected to the search module through the polling probe of the target node and the MutationObserver interface monitor to dynamically load the target web page data, automatically locate and retrieve, and re-render the web page. The extension module includes a manifest file, a user interface, a background service, and a content script. The manifest file is used to provide the browser with extension information, including the extension version and the host permissions required for the extension; the user interface is used for users to customize extension rules; the background service is used to process the extension event program and complete the browser extension using the API provided by Chrome Extensions; the content script is used to inject logic scripts into the target web page to read and modify its content. The background service includes browser tab control, browser local cache control, browser navigation bar control, browser cookie control, and browser timer scheduling control;

[0011] Step 2: Configure the search module. The extension module communicates with the search module via the Http protocol. The search module includes a search service layer and a search platform. Based on the target web page keyword parameters passed by the extension module, the search is performed using preset business search rules and the search results are returned to the extension module.

[0012] In step 1, the Chrome Extensions extension module is based on HTML, JavaScript, and CSS. The specific steps for configuration are as follows:

[0013] Step 1-1: The manifest file is a JSON formatted file used to describe all metadata of the extension. The host permissions required by the extension are applied for to control the extension browser;

[0014] Step 1-2: The user interface includes an HTML file for a pop-up window with preset rules. The preset rules include user-configured rules for enabling monitoring of a target webpage, target webpage keyword location, monitoring of dynamic loading of target webpage data, and subsequent automatic triggering of location retrieval. The user-configured target webpage for enabling monitoring is recorded as the target webpage URL, the target webpage keyword location is recorded as the XPath coordinates of the target webpage keyword, the target webpage data dynamic loading monitoring is recorded as the XPath coordinates of an intermediate state of dynamic loading of the target webpage data, and the rules for subsequent automatic triggering of location retrieval are recorded as the completion conditions of dynamic loading of the target webpage data.

[0015] Step 1-3: The backend service is a JavaScript script that reads the preset rules configured in step 1-2 and loads them into memory. Based on the target webpage URL, it calls the browser navigation bar control of the backend service. The browser navigation bar control includes calling the onCompleted event in the chrome.webNavigation API provided by Chrome Extensions to monitor whether the browser tab has loaded the target webpage URL. If so, the subsequent steps are triggered.

[0016] Step 1-4: calling the browser tab control of the background service, wherein the browser tab control includes calling the chrome.tabs.sendMessage API provided by Chrome Extensions to communicate with the content script and request to monitor the target web page;

[0017] Steps 1-5: The content script includes a JavaScript script that manually implements polling and retrying through the setInterval provided by JavaScript. Based on the intermediate state XPath coordinates, polling is performed within 60 seconds to determine whether a data dynamic loading operation has occurred on the current page. The data dynamic loading operation includes changing the filter conditions, clicking the next page, and refreshing the current page. If a data dynamic loading operation is detected, the MutationObserver interface provided by JavaScript's DOM3 event is called, and the monitoring attribute configuration is preset. The monitoring attribute configuration includes node attribute changes, child node changes, and node data changes, completing the monitoring of DOM structure changes of the target node of the target web page; if the polling times out, the data dynamic loading operation is not detected, and there is no feedback on the page;

[0018] Steps 1-6: If a DOM structure change of the target node is detected, the target webpage data dynamic loading completion status is filtered out from the current DOM structure change according to the completion condition of the dynamic loading of the target webpage data. The target webpage keywords are located using the JQuery library provided by JavaScript based on the XPath coordinates of the target webpage keywords, and the target webpage keywords and corresponding XPath coordinates are extracted.

[0019] Steps 1-7: Call the chrome.tabs.sendMessage API to communicate with the backend service. The backend service sends an HTTP request to the search module via Fetch to transfer the web page to extract the target web page keywords.

[0020] Step 1-8: The extension module receives the request data, calls the chrome.tabs.sendMessage API to communicate with the content script, and repeats steps 1-5 to set up a new round of monitoring to automatically trigger the location retrieval action;

[0021] Step 1-9: Associate the target web page keywords located and extracted in step 1-6 with the search results obtained in step 1-8, splice the HTML script required to re-render the web page based on the association relationship, use the JQuery class library to insert the HTML script into the Xpath coordinates of the target web page keywords, re-render the page, and present the search results on the current page.

[0022] The specific steps of step 2 include the following:

[0023] Step 2-1: The search service layer cleans the parameters of the target webpage keywords returned by the extension module according to preset business rules;

[0024] Step 2-2: The search platform queries the status and derived attributes of the current keyword in its internal library based on the parameters of the target webpage keyword according to preset business rules. The derived attributes are metadata required to re-render the target webpage. The derived attributes are associated with the keyword to create an index service.

[0025] Step 2-3: The search service layer assembles query statements based on the keywords cleaned in step 2-1, calls the search platform for query, and responds to the retrieval results in the Http request of step 1-7.

[0026] The beneficial effects achieved by the present invention are:

[0027] Real-time page feedback of target keyword search results: while browsing the web, users can perceive the derivative attributes of the target keyword of the current web page in real time, expanding the user browsing experience;

[0028] Solve the issue of webRequest not being supported in Chrome Extensions V3: This invention achieves the same effect as the webRequest onCompleted event by introducing a polling probe on the target node and listening to the MutationObserver interface. This solves the problem of the webRequest API being deprecated due to the mandatory upgrade of the Chrome Extensions engine version (from V2 to V3) and provides a new replacement. This innovative practice is applicable not only in this case, but also in scenarios where the webRequest API of previous versions is used, such as the common Chrome Extensions ad blocking.

[0029] Fully automated process, no manual triggering required: This invention automatically monitors dynamic changes in target web page data through user-defined positioning rules and trigger conditions, thereby automatically triggering positioning and retrieval operations. This truly eliminates the need for user-initiated triggering, significantly improving productivity.

[0030] Decoupling between modules allows for replacement of the search platform based on actual business requirements: The overall design of this invention decouples the extension module from the search platform module from the outset. The two communicate via the HTTP protocol, and after locating keywords on the target webpage, data is transferred to the search module for subsequent interaction. The two modules each perform their respective functions independently of each other. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A simplified flowchart of an exemplary embodiment of the present invention;

[0032] Figure 2 is a schematic diagram of an exemplary embodiment of the present invention;

[0033] Figure 3 It is a simplified flowchart of an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0034] Chrome Extensions are used to add auxiliary functions to Google Chrome. The technologies used are web, including HTML, CSS and JS. At the same time, Chrome also provides a rich API to facilitate the extension of Chrome's functions. Its basic components are:

[0035] Configure the basic information of this extension. The corresponding file is manifest.json.

[0036] Click the extension icon to pop up a temporary window. The corresponding module is UI elements.

[0037] The listener for browser events actually extends the browser, and the corresponding module is Service worker.

[0038] Inject your own scripts into the web page to facilitate obtaining web information. The corresponding module is Contentscripts.

[0039] The present invention will be further described below with reference to the accompanying drawings and exemplary embodiments:

[0040] like Figure 1 This is a simplified workflow diagram of a webpage keyword location and retrieval method based on Chrome Extensions and a search platform in an exemplary embodiment of the present invention. The work begins and includes the following steps:

[0041] Step 1: Configure the extension module of Chrome Extensions based on HTML, JavaScript and CSS: the extension module includes a manifest file (manifest), a user interface (UI elements), a background service (Serviceworker), and a content script (Content scripts). Among them, the core background service (Service worker) involves browser tab control, browser local cache control, browser navigation bar control, browser cookie control and browser timer scheduling control. The extension module innovatively replaces webRequest through the collaboration of the above modules and the independently designed target node polling probe and MutationObserver monitoring event. The webRequest is the ability of Chrome Extensions to monitor browser web page netWork requests in the V2 version engine. In addition, the extension module is connected to the search module to complete the dynamic loading monitoring of the target web page data, automatic positioning and retrieval, and re-rendering of the web page to expand the user browsing experience. Taking the positioning of the Qixinbao search list page as an example, the workflow of the extension module is as follows:

[0042] Step 1-1: Configure the host permissions required by the extension in the manifest file of the extension module, including: tabs (browser tab control permission), storage (browser local cache control permission), webNavigation (browser navigation bar control permission), cookies (browser cookie control permission), alarms (browser timer control permission). Compared with existing web monitoring extensions on the market, this case innovatively eliminates the application for webRequest host permissions, which brings the following advantages:

[0043] Improved compatibility with the new Chrome Extensions version plan. webRequest is a capability introduced in the Chrome Extensions V2 engine. However, according to the Chrome Extensions version plan, the V2 engine will stop supporting it in 2023. The latest V3 engine no longer provides webRequest capabilities. Deprecating webRequest provides convenience for subsequent extension upgrades.

[0044] Extensions are more private. They do not need to monitor the user's browser network, making user privacy more secure.

[0045] Step 1-2: Preset rules in the pop-up configuration page provided by the user interface of the extension module. Compared with other user interaction forms of the extension, such as independent configuration pages, the pop-up configuration page achieves the purpose of interaction with the user while not excessively distracting the user's attention, which complies with the principle of minimizing the extended user interface. The preset rules are used by the user to configure the rules for automatically triggering the location search after the target web page data is dynamically loaded. Taking the Qixinbao search list page as an example, the preset configuration includes:

[0046] a) Qixinbao search list page URL: “https: / / www.qixin.com / advanced / search”;

[0047] b) The XPath coordinate of the company name on the result list page is ".company-title";

[0048] c) The XPath coordinates of the intermediate state of the dynamic loading of the result list page are "body>div.advanced-search-home>div.normal-width.container.mt-15>div:nth-child(2)";

[0049] d) The result list page is dynamically loaded and the condition is "$(mutation.removedNodes[0]).attr('id').indexOf('nprogress')!==-1";

[0050] Step 1-3: In the background service of the extension module, read the configuration of step 1-2 and load it into memory. Based on the configured search list page URL, call the onCompleted event in the chrome.webNavigation API provided by Chrome Extensions (the onCompleted event is the page complete loading event provided by the chrome.webNavigation API) to monitor whether the browser tab has loaded the Qixinbao search list page, thereby determining whether to trigger the subsequent process;

[0051] Step 1-4: The user browses the Qixinbao search results page, triggering the listener callback of the onCompleted event in step 1-3. The background service calls the chrome.tabs.sendMessage API to communicate with the content script;

[0052] Steps 1-5: In the content script described in the extension module, use the setInterval provided by JavaScript to manually implement the polling retry operation, dynamically load the intermediate state XPath coordinates according to the configured result list page, and continuously try to determine whether the current page has a dynamic data loading operation within 60 seconds. After detecting that the current page data is dynamically loaded within the specified 60 seconds, initialize the MutationObserver interface, preset the monitoring property configuration, and include: node attribute changes, child node changes, node data changes, and complete the DOM change monitoring of the current page body. If the polling times out, the monitoring node does not detect that the current page has dynamically loaded data, and there is no feedback on the page;

[0053] Steps 1-6: The user browses the Qixinbao search results page and performs corresponding data dynamic loading operations, such as changing the filter conditions, clicking the next page, refreshing the current page, etc., triggering the DOM monitoring set in steps 1-5. Based on the configured dynamic loading completion conditions for the result list page, the dynamic loading completion status of the data is filtered out from the current DOM changes. Based on the configured XPath coordinates of the company names in the result list, the jQuery library is used to locate the company names in the result list and extract the company names that meet the requirements and the corresponding XPath coordinates on the target page;

[0054] Step 1-7: In the extension module's content script, based on the company name set on the result list page extracted in step 1-6, the chrome.tabs.sendMessage API is called to communicate with the extension module's backend service. The backend service then sends an HTTP request via Fetch to pass the company name set to the search module.

[0055] Steps 1-8: After the extension module's backend service sends an HTTP request, it obtains the search results responded by the search module, calls the chrome.tabs.sendMessage API to communicate with the extension module's content script, and repeats steps 1-5 to set up a new round of monitoring to ensure that the location search action is automatically triggered after the subsequent data dynamic loading operation. Compared to the positioning capabilities of the Chrome browser, the present invention can automatically trigger the location search operation of the target web page based on user-defined positioning rules and positioning trigger conditions, thereby improving user browsing efficiency;

[0056] Step 1-9: Loop and associate the company name extracted in step 1-6 with the company name search results obtained in step 1-8. Based on the association, assemble the HTML script required to re-render the webpage. Use the jQuery library to insert the HTML script into the corresponding company name XPath coordinate location, re-render the page, and present the search results on the current page to extend the user's browsing experience.

[0057] Step 2: Configure the search module. The extension module communicates with the search module via the HTTP protocol. The search module includes a search service layer and a search platform. Based on the target webpage keyword parameters passed by the extension module, the search is performed according to the preset business search rules and the search results are returned to the extension module. Taking the search for the company name set on the Qixinbao search list page as an example, the workflow of the search module is as follows:

[0058] Step 2-1: The search service layer in the search module cleans the company name set returned by the extension module according to business rules and removes common parts of the company name, including administrative region names, limited companies, etc.

[0059] Step 2-2: The search platform in the search module is based on business rules. In this case, it is necessary to query whether the current company exists in the internal library based on the company name. If it exists, other derived attributes are queried at the same time, such as current status, contact time, etc., and then these derived attributes are associated with the company name to create an index service. The search module described in the present invention is a retrieval platform based on the internal search service, but in theory you can replace any search platform, even a database service, depending on your actual business scenario. This is also a major advantage of the present invention: decoupling the expansion module from the search module makes the actual implementation process more flexible;

[0060] Step 2-3: The search service layer in the search module assembles the query statement based on the company name set cleaned in step 2-1, calls the search platform query, and responds the retrieval results to the request in step 1-7; the work is completed.

[0061] like Figure 2This is a schematic diagram of the architecture of an exemplary embodiment of the present invention. The system architecture includes five main bodies, namely user terminals, gateway agents, business systems, data platforms, and basic platforms.

[0062] The user terminal refers to the Chrome Extensions client program. Figure 1 The extension module described in the above code runs independently on the client browser. Its main function is to monitor the dynamic loading of target web page data, automatically locate and retrieve it, and re-render the web page.

[0063] The gateway proxy provides reverse proxy and load balancing functions for network requests. In the present invention, its main function is to provide a proxy for user terminals to communicate with business systems. The Nginx is a high-performance HTTP and reverse proxy web server.

[0064] The business system provides a transit function between user terminals and the data platform. For security reasons, user terminals do not communicate directly with the internal data platform, requiring a server-side transit layer. This transit layer's functions include data transit (including data processing and data transmission between upstream and downstream transmissions), user login control, and user permission verification.

[0065] The data platform provides basic data service functions for upper-level business systems. It comprises two submodules: a database and a search platform. The database provides data storage and access for the business systems. In this case, a MySQL database is used. The search platform retrieves target data transmitted by the business systems based on actual business needs and returns search results. In this case, the search platform uses the company's internal FSP search platform.

[0066] The basic platform provides common basic service functions for upper-level business systems. It consists of three submodules: a logging system, a caching system, and SSO (single sign-on). The logging system provides basic logging capabilities for business systems; the caching system provides basic caching capabilities for business systems; and SSO provides login verification capabilities for business system login modules. Depending on actual business needs, the basic services involved may also vary.

[0067] like Figure 3 This is a simplified implementation flow chart of another exemplary embodiment of the present invention. When work begins, the main steps are as follows:

[0068] Step 301: This step is a preparation step, which mainly includes preparing the operating system, installing the Chrome browser, browser version (96.0.1 or above), and searching and installing extensions in the Chrome extension app store;

[0069] Step 302: The user clicks the extension icon in the browser extension bar, opens the panel page, and clicks to log in. Because the user group of this system is intranet users, the concept of account and authority needs to be used, so the company's internal SSO is used to complete the login verification;

[0070] Step 303: The user clicks the extension icon in the browser extension bar to open the extension configuration page, where positioning rules are preset, including user-configured rules for enabling monitoring of target web pages, targeting of target web page keywords, monitoring of dynamic loading of target web page data, and subsequent automatic triggering of positioning retrieval.

[0071] Step 304: The user accesses the target web page configured in step 302 and triggers a dynamic update operation of the current page data;

[0072] Step 305: The extension program dynamically loads and monitors the target webpage data, and automatically locates and retrieves keywords for the target webpage;

[0073] Step 306: The extension program re-renders the web page based on the search results to extend the user's browsing experience, and the work is completed.

[0074] The present invention is mainly used to provide a webpage keyword location retrieval method. Compared with the existing technology, its significant advantages and beneficial effects are as follows:

[0075] Real-time page feedback of target keyword search results: while browsing the web, users can perceive the derivative attributes of the target keyword of the current web page in real time, expanding the user browsing experience;

[0076] Solve the issue of webRequest not being supported in Chrome Extensions V3: This invention achieves the same effect as the webRequest onCompleted event by introducing a polling probe on the target node and listening to the MutationObserver interface. This solves the problem of the webRequest API being deprecated due to the mandatory upgrade of the Chrome Extensions engine version (from V2 to V3) and provides a new replacement. This innovative practice is applicable not only in this case, but also in scenarios where the webRequest API of previous versions is used, such as the common Chrome Extensions ad blocking.

[0077] Fully automated process, no manual triggering required: This invention automatically monitors dynamic changes in target web page data through user-defined positioning rules and trigger conditions, thereby automatically triggering positioning and retrieval operations. This truly eliminates the need for user-initiated triggering, significantly improving productivity.

[0078] Decoupling between modules allows for replacement of the search platform based on actual business requirements: The overall design of this invention decouples the extension module from the search platform module from the outset. The two communicate via the HTTP protocol, and after locating keywords on the target webpage, data is transferred to the search module for subsequent interaction. The two modules each perform their respective functions independently of each other.

[0079] The above embodiments do not limit the present invention in any way. Any other improvements and applications made to the above embodiments in an equivalent manner fall within the scope of protection of the present invention.

Claims

1. A webpage keyword location retrieval method, characterized in that: The following steps are included: 1: Configure the extension module of ChromeExtensions. The extension module is connected to the search module through the polling probe of the target node and the MutationObserver interface monitoring, so as to dynamically load and monitor the target web page data, automatically locate and retrieve, and re-render the web page. The extension module includes a manifest file, a user interface, a background service, and a content script. The manifest file is used to provide the browser with extension information, including the extension version and the host permissions required for the extension; the user interface is used for users to customize extension rules; the background service is used to process the extension event program, and use the API provided by Chrome Extensions to complete the extension of the browser; The content script is used to inject logic scripts into the target web page to read and modify its content. The background service includes browser tab control, browser local cache control, browser navigation bar control, browser cookie control and browser timed scheduling control; Step 2: Configure the search module. The extension module communicates with the search module through the Http protocol. The search module includes a search service layer and a search platform. According to the parameters of the target web page keywords transmitted by the extension module, the search is performed through preset business retrieval rules, and the search results are returned to the extension module; the specific steps of step 2 include the following: Step 2-1: The search service layer cleans the parameters of the target web page keywords transmitted by the extension module according to the preset business rules; Step 2-2: The search platform queries the status and derived attributes of the current keywords in its internal library according to the parameters of the target web page keywords according to the preset business rules. The derived attributes are the metadata required for re-rendering the target web page. The derived attributes are associated with the keywords to create an index service; Step 2-3: The search service layer assembles query statements based on the keywords cleaned in step 2-1, calls the search platform for query, and responds to the retrieval results in the HTTP protocol request.

2. A webpage keyword location retrieval method as claimed in claim 1, characterized in that: In the step 1, the extension module of the Chrome Extensions is based on HTML, JavaScript and CSS, and the specific steps of configuration are as follows: Step 1-1: The manifest file is a JSON formatted file for describing all metadata of the extension, and the host permissions required by the extension are applied for to control the extension browser; Step 1-2: The user interface includes an HTML file for a pop-up window of preset rules, and the preset rules include the target web page for user-configured custom monitoring, target web page keyword positioning, target web page data dynamic loading monitoring and subsequent automatic triggering of positioning retrieval rules, the target web page for user-configured custom monitoring is recorded as the target web page URL, the target web page keyword positioning is recorded as the XPath coordinates of the target web page keyword, the target web page data dynamic loading monitoring is recorded as the intermediate state XPath coordinates of the dynamic loading of the target web page data, and the subsequent automatic triggering of positioning retrieval rules is recorded as the completion condition of the dynamic loading of the target web page data; Step 1-3: The background service is a JavaScript script, which reads the preset rules configured in step 1-2 and loads them into the memory, and calls the browser navigation bar control of the background service according to the target web page URL, and the browser navigation bar control includes calling Chrome The onCompleted event in the chrome.webNavigation API provided by Extensions monitors whether the browser tab loads the target web page URL. If so, the subsequent steps are triggered; Step 1-4: Call the browser tab control of the background service, which includes calling the chrome.tabs.sendMessage API communicates with the content script to request monitoring of the target web page; Step 1-5: The content script includes a JavaScript script, which manually implements polling and retrying through setInterval provided by JavaScript. According to the Xpath coordinates of the intermediate state, it polls within 60 seconds to determine whether the current page has a data dynamic loading operation. The data dynamic loading operation includes changing the screening conditions, clicking the next page, and refreshing the current page. If a data dynamic loading operation is detected, the MutationObserver interface provided by the DOM3 event of JavaScript is called, and the monitoring attribute configuration is preset. The monitoring attribute configuration includes node attribute changes, child node changes, and node data changes, and the DOM structure change monitoring of the target node of the target web page is completed; if the polling times out, the data dynamic loading operation is not detected, and there is no feedback on the page; Step 1-6: If the DOM structure change of the target node is monitored, according to the completion condition of the dynamic loading of the target web page data, the state of the dynamic loading of the data is filtered out from the current DOM structure change, and the target web page keywords are located according to the XPath coordinates of the target web page keywords, and the target web page keywords and the corresponding XPath are extracted using the JQuery library provided by JavaScript. coordinates; Step 1-7: Call chrome.tabs.sendMessage API to communicate with the background service, and the background service sends an HTTP protocol request to the search module through Fetch to transmit the web page to extract the target web page keywords; Step 1-8: The extension module receives the request data, calls chrome.tabs.sendMessage API to communicate with the content script, and repeats step 1-5 to set a new round of monitoring to automatically trigger the positioning retrieval action; Step 1-9: Associate the target web page keywords located and extracted in step 1-6 with the search results obtained in step 1-8, splice the Html script required to re-render the web page according to the association relationship, use the JQuery library to insert the Html script into the Xpath coordinates of the target web page keywords, re-render the page, and present the search results on the current page. .

Citation Information

Patent Citations

  • Web page element searching method and device, and computing equipment

    CN113918789A

  • Method and device for streaming content

    WO2020055333A1