Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imba97 committed Oct 11, 2019
1 parent 0deee3c commit 32cf5cb
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=website)](http://btools.cc)

## 前言
如果你想参观代码,请先看这里。
如果你想参观代码(屎山),请先看这里。
代码是纯jQuery项目,没其他框架,没用其他工具,目录结构、文件名、函数名我记几个儿随便瞎起的,所以观赏性极差,劝你做好心理准备。

## 介绍
Expand Down Expand Up @@ -69,6 +69,9 @@ Btools(逼砣),本插件主要目的是以B站为主的网站页面优化,
* 功能名称变更,原“获取专题文章中的URL”改为“网址链接转换”,并加入到专栏助手
* 新功能:专栏助手 > 查看原图
* 新功能:专栏助手 > 新窗口打开原图
* `2019-08-28`
* 查看原图功能兼容火狐浏览器
* 失效视频详情信息的标题部分改为该视频的AV号

* #### [历史更新](https://btools.cc/tag/update/)

Expand Down
22 changes: 18 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var isChrome = !!chrome;
chrome = chrome || browser;

var BtoolsInfo = {
version: '1.0.9',
releaseVersion: 10
version: '1.1.0',
releaseVersion: 11
}

if(isChrome) {
Expand All @@ -24,7 +24,6 @@ chrome.runtime.onInstalled.addListener(function(details) {

chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(request);
switch(request.type) {
case 'fetch':
fetch(request.url)
Expand All @@ -33,8 +32,23 @@ function(request, sender, sendResponse) {
.catch(function(error) { return sendResponse(null) });
return true; // Will respond asynchronously.
break;
case 'post':
fetch(request.url, {
method: 'POST',
mode: 'cors',
credentials: 'include',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: JSON.stringify(request.data)
})
.then(function(response) { return response.json() })
.then(function(json) { return sendResponse(json) })
.catch(function(error) { return sendResponse(null) });
return true; // Will respond asynchronously.
break;
case 'getInfo':
sendResponse(BtoolsInfo)
sendResponse(BtoolsInfo);
break;
}
});
Expand Down
2 changes: 1 addition & 1 deletion core/openImg/m.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
height: 100%;
background-color: #000;
opacity: 0.5;
z-index: -1;
z-index: 999999;
}

/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
Expand Down
6 changes: 3 additions & 3 deletions core/openImg/m.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ openImgSet.timer = setInterval(function(){
}
var imageViewHTML = '<div id="BtoolsImageView">' +
'<img src="' + imageReg[1] + '">' +
'<div class="BtoolsImageViewBg"></div>' +
'</div>';
'</div>' +
'<div class="BtoolsImageViewBg"></div>';
$('body').append(imageViewHTML);
var imageTimerNum = 0;
var imageTimer = setInterval(function() {
Expand All @@ -136,7 +136,7 @@ openImgSet.timer = setInterval(function(){
}, 100);

$('#BtoolsImageView').click(function() {
$('#BtoolsImageView').remove();
$('#BtoolsImageView,.BtoolsImageViewBg').remove();
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion core/viv/m.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function media_info(mid) {
}
var avNum = /video\/(\d+)/i.exec(f.link)[1];
if(f.title === '已失效视频') {
var videoName = f.page > 1 ? '希望通过简介和分P名帮你想起来' : f.title;
var videoName = f.page > 1 ? 'av' + avNum : f.title;
var bilibilijjText = '去哔哩哔哩唧唧看看有没有资源?';
} else {
var bilibilijjText = '跳转到哔哩哔哩唧唧下载?';
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"manifest_version": 2,
"name": "Btools",
"version": "1.0.9",
"version": "1.1.0",
"description": "__MSG_pluginDesc__",
"icons":
{
Expand Down
2 changes: 1 addition & 1 deletion manifest_chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"manifest_version": 2,
"name": "Btools",
"version": "1.0.9",
"version": "1.1.0",
"description": "__MSG_pluginDesc__",
"icons":
{
Expand Down

0 comments on commit 32cf5cb

Please sign in to comment.