Skip to content

Instantly share code, notes, and snippets.

@andyed
Created December 7, 2009 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyed/250639 to your computer and use it in GitHub Desktop.
Save andyed/250639 to your computer and use it in GitHub Desktop.
Jetpack for Site Search of Current Tab
/*
@author: Andy Edmonds
@url: http://www.twitter.com/andyed
@email:andyed@gmail.com
@title: Bing Site Searcher
@description: Loads Bing site search of current site into slidebar.
@version: 0.2
*/
jetpack.future.import("slideBar")
jetpack.slideBar.append({
onReady: function (slide) {
function onTabFocused(tab) {
$(".frame", slide.contentDocument).attr("src", "http://www.google.com/m?dc=mgcgo&source=mobileproducts&q=site%3A" + jetpack.tabs.focused.url);
}
// Initialize
onTabFocused(jetpack.tabs.focused);
jetpack.tabs.onFocus(function () onTabFocused(this));
},
html: '<iframe class="frame" height="99%" width="100%" border="no" style="border:none;padding:0;margin:0;background-color:#fff;" src="http://www.google.com/search?q=site%3A"></frame>',
icon: "http://m.bing.com/favicon.ico",
width: 300,
persist: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment