CN107632990B - Information display method and device - Google Patents

Information display method and device Download PDF

Info

Publication number
CN107632990B
CN107632990B CN201610570069.7A CN201610570069A CN107632990B CN 107632990 B CN107632990 B CN 107632990B CN 201610570069 A CN201610570069 A CN 201610570069A CN 107632990 B CN107632990 B CN 107632990B
Authority
CN
China
Prior art keywords
domain name
browser
address corresponding
network request
address
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
CN201610570069.7A
Other languages
Chinese (zh)
Other versions
CN107632990A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610570069.7A priority Critical patent/CN107632990B/en
Publication of CN107632990A publication Critical patent/CN107632990A/en
Application granted granted Critical
Publication of CN107632990B publication Critical patent/CN107632990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an information display method and device, on one hand, the actual IP address of a domain name request under the current page can be displayed to a developer in a browser, so that the developer can intuitively judge whether the set Host information is effective on the current page, and meanwhile, the situation that the actual server IP of the network request is checked through repeated operation is avoided, and the development efficiency of the developer is finally improved; on the other hand, developers can quickly empty DNS cache files of the browser through the technical scheme of the invention. The information display method comprises the following steps: saving a domain name list to be monitored; after a browser sends a network request, acquiring a domain name in the network request and an IP address corresponding to the domain name; and judging whether the domain name exists in the domain name list, and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise of existence.

Description

Information display method and device
Technical Field
The invention relates to the technical field of computers and software thereof, in particular to a method and a device for displaying information.
Background
The Host file is a system file without an extension name, can be opened by a notebook and other tools, and has the functions of establishing a correlation 'database' between a plurality of commonly used website domain names and IP addresses corresponding to the commonly used website domain names, when a user inputs a website needing to be logged in a browser, the system can automatically search the corresponding IP address from the Hosts file at first, once the website is found, the system can immediately open the corresponding webpage, and if the website is not found, the system can submit the website to a DNS domain name resolution server for IP address resolution.
In the web front-end development process, developers need to switch frequently in development, test and online environments, so that Host files of an operating system need to be changed frequently; however, due to the cache mechanism of the browser, the browser searches the DNS cache file first when sending the request, and if the DNS cache file can find the IP address corresponding to the domain name, the request is sent according to the IP address in the DNS cache file, so that when the developer changes the Host file of the system, the browser does not necessarily send the request with the latest Host information, and therefore the developer cannot intuitively determine whether the set Host information is valid on the current page, and the development efficiency of the developer is finally reduced.
In the prior art, taking a Chrome browser as an example, an operation flow of a developer viewing a network request actual server IP in the Chrome browser includes the following steps:
1) opening a Chrome browser developer tool;
2) switching to a Network label page;
3) checking a 'Remote Address' item on the right key of the title bar;
4) refreshing a page;
5) the hostname to be viewed is searched for.
As can be seen from the above operation flows, the existing operation flows are complicated, and the operation flows need to be repeated for multiple times to check for multiple times, which also reduces the development efficiency of developers to a certain extent.
Disclosure of Invention
In view of the above, the present invention provides an information displaying method and apparatus, which on one hand can display the actual IP address of the domain name request in the current page to the developer in the browser, so that the developer can not only intuitively judge whether the set Host information is valid in the current page, but also avoid checking the actual server IP of the network request through repeated operations, and finally improve the development efficiency of the developer; on the other hand, developers can quickly clear DNS cache files of the browser through the technical scheme of the invention, and the development efficiency of the developers is also improved to a certain extent.
To achieve the above object, according to one aspect of the present invention, there is provided a method for displaying information.
The information display method comprises the following steps: saving a domain name list to be monitored; after a browser sends a network request, acquiring a domain name in the network request and an IP address corresponding to the domain name; and judging whether the domain name exists in the domain name list, and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise of existence.
Optionally, the step of obtaining the domain name in the network request and the IP address corresponding to the domain name includes: registering a callback function in the browser; and receiving the domain name of the network request and the IP address corresponding to the domain name, which are returned by the callback function.
Optionally, after the step of displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser, the method further includes: and clearing the DNS cache file of the browser according to the received browser cache clearing command.
According to another aspect of the present invention, there is provided an apparatus for displaying information.
The information display device of the present invention is characterized by comprising: the storage module is used for storing a domain name list to be monitored; the acquisition module is used for acquiring a domain name in a network request and an IP address corresponding to the domain name after the browser sends the network request; and the display module is used for judging whether the domain name exists in the domain name list and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise of existence.
Optionally, the obtaining module is further configured to: and registering a callback function in the browser, and then receiving the domain name of the network request and the IP address corresponding to the domain name, which are returned by the callback function.
Optionally, the system further comprises a file removing module, configured to remove a DNS cache file of the browser according to the received browser cache removal command.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the above-described illustrative embodiments of information.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method of any of the above presented embodiments of information.
According to the technical scheme of the invention, on one hand, the domain name of the network request and the corresponding IP address can be displayed in the page returned by the browser, so that for the domain name concerned by a developer, the developer can intuitively judge whether the set Host information is effective in the current page, and meanwhile, the situation that the actual server IP of the network request is checked through repeated operation is avoided, and the development efficiency of the developer is finally improved; on the other hand, developers can quickly clear DNS cache files of the browser through the technical scheme of the invention, and the development efficiency of the developers is also improved to a certain extent.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a method for displaying information according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a device for displaying information according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a method for displaying information according to an embodiment of the present invention. As shown in fig. 1, the information presentation method according to the embodiment of the present invention is executed by a computer running a browser, and the method mainly includes the following steps S10 to S13.
Step S10: and saving a domain name list to be monitored. In this step, the developer can store the concerned domain name into the domain name list, thereby realizing the monitoring of the concerned domain name.
Step S11: after a browser sends a network request, a domain name in the network request and an IP address corresponding to the domain name are obtained. In this step, the callback function is registered in the browser, and after the browser sends out a network request, the callback function extracts the domain name in the network request and the IP address corresponding to the domain name, so as to obtain the domain name of the network request and the IP address corresponding to the domain name, which are returned by the callback function.
Step S12: judging whether the domain name exists in the domain name list, if so, executing step S13; if the domain name is not in the saved domain name list, return to step S11.
Step S13: and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser. After the domain name and the corresponding IP address in the network request are obtained in step S11, if the domain name exists in the domain name list, it indicates that the domain name is a domain name concerned by the developer, so that the domain name and the IP address corresponding to the domain name are displayed on the page returned by the browser.
According to the technical scheme, the cache clearing button is additionally arranged, when a developer finds that the domain name and the corresponding IP address displayed on the page returned by the browser are different from the IP address corresponding to the newly set domain name, the browser does not use the latest IP address for access, and therefore the developer can clear the DNS cache file of the browser through the cache clearing button; of course, the developer can also clear the DNS cache file of the browser by operating the cache clear button whenever the cache needs to be cleared.
Fig. 2 is a schematic diagram of a device for displaying information according to an embodiment of the present invention. As shown in fig. 2, the information display apparatus 20 and the browser of the embodiment of the present invention are disposed in the same computer, and mainly include: a saving module 21, an obtaining module 22, and a display module 23; the storage module 21 is configured to store a domain name list to be monitored; the obtaining module 22 is configured to obtain a domain name in the network request and an IP address corresponding to the domain name after the browser sends the network request; the display module 23 is configured to determine whether the domain name exists in the domain name list, and display the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise that the domain name exists.
The obtaining module 22 may also be configured to register a callback function in the browser, and then receive a domain name of the network request and an IP address corresponding to the domain name, where the domain name is returned by the callback function.
Presentation apparatus 20 may further include a file removal module configured to remove a DNS cache file of the browser according to the received browser cache removal command.
According to the technical scheme of the embodiment of the invention, on one hand, as the domain name of the network request and the corresponding IP address can be displayed in the page returned by the browser, for the domain name concerned by the developer, the developer can intuitively judge whether the set Host information is effective in the current page, and meanwhile, the situation that the actual server IP of the network request is checked through repeated operation is avoided, and the development efficiency of the developer is finally improved; on the other hand, developers can quickly clear DNS cache files of the browser through the technical scheme of the invention, and the development efficiency of the developers is also improved to a certain extent.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. A method for displaying information is characterized by comprising the following steps:
saving a domain name list to be monitored;
after a browser sends a network request, acquiring a domain name in the network request and an IP address corresponding to the domain name;
judging whether the domain name exists in the domain name list or not, and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise of existence;
the step of obtaining the domain name in the network request and the IP address corresponding to the domain name includes: registering a callback function in the browser; receiving the domain name of the network request and the IP address corresponding to the domain name, which are returned by the callback function;
and after the step of displaying the domain name and the IP address corresponding to the domain name on the page returned by the browser, when the domain name and the corresponding IP address displayed on the page returned by the browser are different from the IP address corresponding to the domain name set by the system, clearing the DNS cache file of the browser according to the received command for clearing the cache of the browser.
2. An apparatus for displaying information, comprising:
the storage module is used for storing a domain name list to be monitored;
the acquisition module is used for acquiring a domain name in a network request and an IP address corresponding to the domain name after the browser sends the network request;
the display module is used for judging whether the domain name exists in the domain name list or not and displaying the domain name and the IP address corresponding to the domain name on a page returned by the browser on the premise of existence;
the acquisition module is further configured to: registering a callback function in the browser, and then receiving a domain name of the network request and an IP address corresponding to the domain name, which are returned by the callback function;
and the file clearing module is used for clearing the DNS cache file of the browser according to the received browser cache clearing command when the domain name displayed on the page returned by the browser and the corresponding IP address are different from the IP address corresponding to the domain name set by the system.
3. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of claim 1.
4. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of claim 1.
CN201610570069.7A 2016-07-19 2016-07-19 Information display method and device Active CN107632990B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610570069.7A CN107632990B (en) 2016-07-19 2016-07-19 Information display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610570069.7A CN107632990B (en) 2016-07-19 2016-07-19 Information display method and device

Publications (2)

Publication Number Publication Date
CN107632990A CN107632990A (en) 2018-01-26
CN107632990B true CN107632990B (en) 2021-06-29

Family

ID=61112384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610570069.7A Active CN107632990B (en) 2016-07-19 2016-07-19 Information display method and device

Country Status (1)

Country Link
CN (1) CN107632990B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737617B (en) * 2020-06-15 2024-05-07 北京达佳互联信息技术有限公司 Page resource loading method and device, electronic equipment and storage medium
CN113765731B (en) * 2020-06-28 2023-09-05 北京沃东天骏信息技术有限公司 Information processing method, apparatus and computer readable storage medium
CN113190288B (en) * 2021-05-08 2024-06-04 首约科技(北京)有限公司 Freely-switched page plug-in unit with different environments

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973506A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Domain name verifying method, device and system
CN104219200A (en) * 2013-05-30 2014-12-17 杭州迪普科技有限公司 Device and method for protection from DNS cache attack

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102882991B (en) * 2012-09-29 2016-03-30 北京奇虎科技有限公司 A kind of browser and carry out the method for domain name mapping
CN103561036A (en) * 2013-11-12 2014-02-05 深信服网络科技(深圳)有限公司 Request intercepting method and device in white-list internet surfing environment
US9727661B2 (en) * 2014-06-20 2017-08-08 Lg Electronics Inc. Display device accessing broadcast receiver via web browser and method of controlling therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973506A (en) * 2013-01-30 2014-08-06 腾讯科技(深圳)有限公司 Domain name verifying method, device and system
CN104219200A (en) * 2013-05-30 2014-12-17 杭州迪普科技有限公司 Device and method for protection from DNS cache attack

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Find IP of website via Chrome console;Mechanical snail;《https://superuser.com/questions/456512/find-ip-of-website-via-chrome-console》;20120802;Mechanical snail的回复 *

Also Published As

Publication number Publication date
CN107632990A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
US9729499B2 (en) Browser and method for domain name resolution by the same
US20060259867A1 (en) System and method for automatic generation of browsing favorites
CN107632990B (en) Information display method and device
CN107861865B (en) SDK positioning method, device and computer readable storage medium
US20130159275A1 (en) Information searching system and method
CN111310007B (en) Webpage interface query method and device, electronic equipment and storage medium
US20220318319A1 (en) Focus Events
WO2014153991A1 (en) Browser collection method, system and terminal device, and computer-readable storage medium
CN106033433B (en) Information searching method and device
CN111147616A (en) Resource acquisition method and device, electronic equipment and storage medium
WO2012151752A1 (en) Annotating search results with images
US10095791B2 (en) Information search method and apparatus
CN110430083B (en) Positioning processing method for proxy forwarding request and server
CN108197253B (en) Equipment query method, device and equipment of cloud monitoring platform
JP2010231442A (en) Information provision device
CN111290912A (en) Single-page application performance monitoring method and device and electronic equipment
WO2016011699A1 (en) Method and device for use in configuring navigation page of browser
CN105589940A (en) Safety management operation and maintenance service platform based on unstructured real-time database
CN107306308B (en) Page response method and device
EP3842753A2 (en) Method and apparatus for positioning vehicle, vehicle, storage medium, and computer program product
CN105592173A (en) Method and system for preventing DNS (Domain Name System) cache from being stained and local DNS server
JP5116447B2 (en) Policy generation system, program, and recording medium
JP5538459B2 (en) Information processing apparatus and method
JP5616473B2 (en) Information processing apparatus and information processing method
JP6212373B2 (en) Operation log management apparatus and method

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