Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Moffat committed Dec 23, 2013
0 parents commit e7d5aae
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
4 changes: 4 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
chrome.omnibox.onInputEntered.addListener(function(text) {
var url = hashIt(text);
chrome.tabs.update({url: url, active: true});
});
6 changes: 6 additions & 0 deletions jquery-1.10.1.min.js

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"manifest_version": 2,

"name": "#://",
"description": "PoC: Expands available domain names by allowing any text to be used",
"version": "1.0",

"omnibox": {
"keyword" : "#"
},

"background": {
"scripts": [
"sha1.js",
"utils.js",
"background.js"
]
},

"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*",
"file://*/*"
],

"js": [
"sha1.js",
"utils.js",
"jquery-1.10.1.min.js",
"transform_links.js"
]
}
],

"permissions": [
"*://*/*"
]
}
15 changes: 15 additions & 0 deletions sha1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions transform_links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$(function() {
$.each($("a[href^='#://']"), function(i, el) {
el = $(el);
var original = el.attr("href");
var hash = hashIt(original);
el.attr("href", hash);
el.attr("data-original", original);
});
});
4 changes: 4 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function hashIt(text) {
var url = "http://" + CryptoJS.SHA1(text) + ".com";
return url;
}

0 comments on commit e7d5aae

Please sign in to comment.