Skip to content
Browse files

merge

  • Loading branch information...
2 parents 5c63632 + 5e77289 commit f681cf3a1e85378d3ec3711063e47f76d0c5a8f1 @yangsu committed Apr 14, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/js/background.js
View
13 src/js/background.js
@@ -23,8 +23,19 @@ $(document).ready(function () {
});
});
+function handleDOM(dom) {
+ var links = dom.getElementsByTagName('a'),
+ i, url;
+ for (i = 0; i < links.length; i += 1) {
+ url = links[i].getAttribute('href');
+ if (url.indexOf('http://') === 0 || url.indexOf('https://')) {
+ cacheURL(url);
+ }
+ }
+}
+
function cacheURL(url) {
$.get(url, function (data) {
- console.log(data);
+ localStorage[url] = data;
});
}

0 comments on commit f681cf3

Please sign in to comment.
Something went wrong with that request. Please try again.