Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
1. Add analytics code
2. More precise URL matching (Solved #25)
  • Loading branch information
zacyu committed Jun 16, 2015
1 parent 2dc1ac0 commit a6ab389
Show file tree
Hide file tree
Showing 5 changed files with 3,189 additions and 4 deletions.
1 change: 1 addition & 0 deletions background.html
@@ -1,4 +1,5 @@
<html>
<script type="text/javascript" src="resource.js"></script>
<script type="text/javascript" src="background.js"></script>
<script type="text/javascript" src="upalytics_ch.js"></script>
</html>
2 changes: 0 additions & 2 deletions background.js
Expand Up @@ -300,13 +300,11 @@ chrome.webRequest.onBeforeRequest.addListener(function(details) {

chrome.webRequest.onHeadersReceived.addListener(function(details) {
var blockingResponse = {};
console.log(details);
if (getOption("replace") == "on") {
if (details.url.indexOf('retry=1') < 0) {
blockingResponse.redirectUrl = details.url + '&retry=1';
}
}
console.log(blockingResponse);
return blockingResponse;
}, {
urls: ["http://g3.letv.cn/vod/v2/*"]
Expand Down
2 changes: 1 addition & 1 deletion bilibili_injected.js
Expand Up @@ -298,7 +298,7 @@
intilize_style();
$("html").addClass("bilibili-helper");
var bili_reg = /\/video\/av([0-9]+)\/(?:index_([0-9]+)\.html)?$/,
urlResult = bili_reg.exec(document.URL.split('#')[0]);
urlResult = bili_reg.exec(document.URL.split('#')[0].split('?')[0]);
if (urlResult) {
biliHelper.avid = urlResult[1];
biliHelper.page = urlResult[2];
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -25,7 +25,7 @@
"manifest_version": 2,
"name": "__MSG_extName__",
"options_page": "options.html",
"permissions": [ "alarms", "contextMenus", "cookies", "notifications", "storage", "tabs", "webRequest", "webRequestBlocking", "*://*.bilibili.com/*", "http://g3.letv.cn/*" ],
"permissions": [ "alarms", "contextMenus", "cookies", "notifications", "storage", "tabs", "webRequest", "webRequestBlocking", "http://*/", "https://*/" ],
"update_url": "https://clients2.google.com/service/update2/crx",
"version": "0.6.9",
"web_accessible_resources": [ "bilibili-helper.woff", "template.html", "imgs/icon-32.png", "imgs/loading.gif" ]
Expand Down

0 comments on commit a6ab389

Please sign in to comment.