1

A bookmarklet I've developed and use in other browsers does not work in Chrome. More specifically, I've added it to the Chrome Bookmarks Bar, and it will not fire on Chrome's default home screen, regardless of whether I click it on the Bookmarks Bar, or in the drop down Bookmarks menu. Yet, when I use it when Chrome is on any other page, it works just fine. Here is the redacted bookmarklet:

javascript:window.location.href="http://part.of."+prompt("Website:")+".the.web.site.com";

Simple, right? Yet, why doesn't this work within Chrome? Safari, even when it's on its Top Sites "meta page" responds to this bookmarklet without issue.

4

2 に答える 2

1

この投稿によると、これは Chrome の意図的なセキュリティ機能のようです。

http://code.google.com/p/chromium/issues/detail?id=98871#c2

于 2012-06-11T19:56:51.453 に答える
0

これを試して、ニーズに合わせて調整してください。標準の新しいタブ ページで動作します。

javascript:search_terms=prompt('Search terms?');window.location='http://www.google.com/search?q='+search_terms+'site:history.com';
于 2016-05-20T21:05:06.367 に答える