1
0
mirror of https://github.com/golang/go synced 2024-11-18 07:04:52 -07:00
go/misc/chrome/gophertool/background.js
Brad Fitzpatrick 9e811683f1 gophertool: make work with latest Chrome extension security restrictions
No JavaScript in HTML anymore.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6619066
2012-10-07 17:56:10 -07:00

10 lines
255 B
JavaScript

chrome.omnibox.onInputEntered.addListener(function(t) {
var url = urlForInput(t);
if (url) {
chrome.tabs.getSelected(null, function(tab) {
if (!tab) return;
chrome.tabs.update(tab.id, { "url": url, "selected": true });
});
}
});