谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

谷歌搜索设置只在某网站搜索

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

Have you ever wanted to search the site you’re viewing, but the built-in search box is either hard to find, or doesn’t work very well? Here’s how to add a special keyword bookmark that searches the site you’re viewing using Google’s site: search operator.

您是否曾经想搜索过您正在浏览的网站,但是内置的搜索框要么很难找到,要么效果不佳? 以下是添加特殊的关键字书签的方法,该书签可使用Google的站点搜索正在搜索的站点:搜索运算符。

This technique should work in either Google Chrome or Firefox—in Firefox you’ll want to create a regular bookmark and add the script into the keyword field, and for Google Chrome just follow the steps we’ve provided below.

这项技术应在Google Chrome或Firefox中都可以使用-在Firefox中,您需要创建一个常规书签并将脚本添加到关键字字段中,对于Google Chrome,只需遵循我们下面提供的步骤即可。

在Chrome中创建特定于站点的搜索 (Creating a Site Specific Search in Chrome)

Right-click anywhere on the Chrome location bar and choose “Edit Search Engines”, and then click the Add button.

右键单击Chrome位置栏上的任意位置,然后选择“编辑搜索引擎”,然后单击“添加”按钮。

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

Now give the search engine a name and a unique keyword—you’ll want to make sure that it’s totally unique and unlikely to be used anywhere else in a URL, which makes it easier to use. I’m using “gs” as the keyword.

现在给搜索引擎一个名称和一个唯一的关键字-您将要确保它是唯一的,并且不太可能在URL的其他任何地方使用,这使其更易于使用。 我使用“ gs”作为关键字。

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

Now the important part—put the following into the URL box.

现在重要的部分-将以下内容放入URL框中。

javascript:location.href='http://www.google.com/search?q=site:'+window.location.hostname+'%20%s';

javascript:location.href='http://www.google.com/search?q=site:'+window.location.hostname+'%20%s';

Now once you saved the search engine, you can use the Ctrl + L shortcut key to highlight the location bar text, and type “gs” into the bar. You’ll notice the text on the right-hand side tells you to “Press Tab to search gs”. So press Tab.

现在,保存搜索引擎后,可以使用Ctrl + L快捷键突出显示位置栏文本,然后在栏中输入“ gs”。 您会注意到右侧的文本告诉您“按Tab键搜索gs”。 因此,按Tab。

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

Now just type in whatever you’d like to search the site for…

现在,只要输入您想在网站上搜索的内容即可...

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

And there you are, a site: search using Google for the site that you’re currently viewing.

在这里,您将找到一个站点:使用Google搜索您当前正在浏览的站点。

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

The great thing about this is that it works for any site—here’s an example of searching Lifehacker.

很棒的是,它适用于任何站点,这是搜索Lifehacker的示例。

谷歌搜索设置只在某网站搜索_如何使用Google搜索仅搜索您正在查看的网站

Thanks to the Lifehacker commenter Revolutions for the original idea, which we very slightly modified.

多亏了Lifehacker评论员Revolutions提出了最初的想法,我们对其进行了稍微的修改。

翻译自: https://www.howtogeek.com/howto/39429/how-to-search-just-the-site-youre-viewing-using-google-search/

谷歌搜索设置只在某网站搜索