diff --git a/package.json b/package.json index b0105d9..7759e74 100644 --- a/package.json +++ b/package.json @@ -1,98 +1,98 @@ { - "name": "bilibili-helper-master", - "version": "1.2.16-beta.1", - "description": "bilibili-helper", - "main": "index.js", - "dependencies": { - "color": "^3.0.0", - "fetch-progress": "^1.2.0", - "ffmpeg.js": "^3.1.9001", - "history": "^4.7.2", - "jquery": "^3.4.0", - "lodash": "^4.17.10", - "md5": "^2.2.1", - "mobx": "^5.0.3", - "mobx-react": "^5.2.3", - "mobx-react-router": "^4.0.4", - "moment": "^2.22.2", - "npm": "^6.6.0", - "ocrad.js": "0.0.1", - "ocradjs-browser.js": "^1.0.2", - "prop-types": "^15.6.2", - "react": "^16.4.1", - "react-dom": "^16.4.1", - "react-router": "^4.3.1", - "react-transition-group": "^1.2.1", - "react-virtualized": "^9.21.0", - "store": "^2.0.12", - "styled-components": "^4.1.2", - "systemjs": "^2.1.1", - "url-parse": "^1.4.3" - }, - "devDependencies": { - "babel-core": "^6.26.3", - "babel-eslint": "^10.0.1", - "babel-loader": "^7.1.4", - "babel-plugin-add-module-exports": "^0.2.1", - "babel-plugin-import": "^1.6.5", - "babel-plugin-lodash": "^3.3.2", - "babel-plugin-styled-components": "^1.4.0", - "babel-plugin-syntax-dynamic-import": "^6.18.0", - "babel-plugin-transform-builtin-classes": "^0.6.1", - "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-decorators": "^6.24.1", - "babel-plugin-transform-decorators-legacy": "^1.3.5", - "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", - "babel-plugin-transform-es2015-modules-umd": "^6.24.1", - "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", - "babel-plugin-transform-es3-property-literals": "^6.22.0", - "babel-plugin-transform-function-bind": "^6.22.0", - "babel-plugin-transform-object-assign": "^6.22.0", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-plugin-transform-react-jsx": "^6.24.1", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.7.0", - "babel-preset-es2015": "^6.24.1", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-0": "^6.24.1", - "clean-webpack-plugin": "^0.1.19", - "concurrently": "^4.1.0", - "copy-webpack-plugin": "^4.5.1", - "css-loader": "^2.1.0", - "cssnano": "^4.0.3", - "eslint": "^5.9.0", - "eslint-loader": "^2.1.1", - "eslint-plugin-react": "^7.11.1", - "html-webpack-plugin": "^4.0.0-alpha", - "json-loader": "^0.5.7", - "load-grunt-tasks": "^3.5.2", - "merge-jsons-webpack-plugin": "^1.0.18", - "mini-css-extract-plugin": "^0.4.0", - "node-sass": "^4.9.0", - "optimize-css-assets-webpack-plugin": "^5.0.0", - "react-hot-loader": "^4.3.3", - "sass-loader": "^7.0.3", - "style-loader": "^0.21.0", - "uglifyjs-webpack-plugin": "^1.2.7", - "webpack": "^4.10.2", - "webpack-bundle-analyzer": "^3.1.0", - "webpack-cli": "^3.0.3", - "webpack-dev-server": "^3.1.4", - "write-json-webpack-plugin": "^1.1.0", - "zip-webpack-plugin": "^3.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-beta.49" - }, - "scripts": { - "grunt": "grunt", - "watch": "webpack --env.DEBUG=true --config=webpack.config.development.js --watch --progress", - "build": "webpack --production --progress", - "build:test": "webpack --env.DEBUG=true --production --progress" - }, - "author": "zacyu & drowsyflesh", - "license": "MIT", - "repository": "/~https://github.com/zacyu/bilibili-helper", - "readme": "/source/README.md" + "name": "bilibili-helper-master", + "version": "1.2.16-beta.2", + "description": "bilibili-helper", + "main": "index.js", + "dependencies": { + "color": "^3.0.0", + "fetch-progress": "^1.2.0", + "ffmpeg.js": "^3.1.9001", + "history": "^4.7.2", + "jquery": "^3.4.0", + "lodash": "^4.17.10", + "md5": "^2.2.1", + "mobx": "^5.0.3", + "mobx-react": "^5.2.3", + "mobx-react-router": "^4.0.4", + "moment": "^2.22.2", + "npm": "^6.6.0", + "ocrad.js": "0.0.1", + "ocradjs-browser.js": "^1.0.2", + "prop-types": "^15.6.2", + "react": "^16.4.1", + "react-dom": "^16.4.1", + "react-router": "^4.3.1", + "react-transition-group": "^1.2.1", + "react-virtualized": "^9.21.0", + "store": "^2.0.12", + "styled-components": "^4.1.2", + "systemjs": "^2.1.1", + "url-parse": "^1.4.3" + }, + "devDependencies": { + "babel-core": "^6.26.3", + "babel-eslint": "^10.0.1", + "babel-loader": "^7.1.4", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-import": "^1.6.5", + "babel-plugin-lodash": "^3.3.2", + "babel-plugin-styled-components": "^1.4.0", + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-builtin-classes": "^0.6.1", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-plugin-transform-decorators-legacy": "^1.3.5", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", + "babel-plugin-transform-es3-property-literals": "^6.22.0", + "babel-plugin-transform-function-bind": "^6.22.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-react-jsx": "^6.24.1", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-react": "^6.24.1", + "babel-preset-stage-0": "^6.24.1", + "clean-webpack-plugin": "^0.1.19", + "concurrently": "^4.1.0", + "copy-webpack-plugin": "^4.5.1", + "css-loader": "^2.1.0", + "cssnano": "^4.0.3", + "eslint": "^5.9.0", + "eslint-loader": "^2.1.1", + "eslint-plugin-react": "^7.11.1", + "html-webpack-plugin": "^4.0.0-alpha", + "json-loader": "^0.5.7", + "load-grunt-tasks": "^3.5.2", + "merge-jsons-webpack-plugin": "^1.0.18", + "mini-css-extract-plugin": "^0.4.0", + "node-sass": "^4.9.0", + "optimize-css-assets-webpack-plugin": "^5.0.0", + "react-hot-loader": "^4.3.3", + "sass-loader": "^7.0.3", + "style-loader": "^0.21.0", + "uglifyjs-webpack-plugin": "^1.2.7", + "webpack": "^4.10.2", + "webpack-bundle-analyzer": "^3.1.0", + "webpack-cli": "^3.0.3", + "webpack-dev-server": "^3.1.4", + "write-json-webpack-plugin": "^1.1.0", + "zip-webpack-plugin": "^3.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-beta.49" + }, + "scripts": { + "grunt": "grunt", + "watch": "webpack --env.DEBUG=true --config=webpack.config.development.js --watch --progress", + "build": "webpack --production --progress", + "build:test": "webpack --env.DEBUG=true --production --progress" + }, + "author": "zacyu & drowsyflesh", + "license": "MIT", + "repository": "/~https://github.com/zacyu/bilibili-helper", + "readme": "/source/README.md" } \ No newline at end of file diff --git a/src/js/components/configPage/List/ListItem.js b/src/js/components/configPage/List/ListItem.js index f1b173c..b3e9321 100644 --- a/src/js/components/configPage/List/ListItem.js +++ b/src/js/components/configPage/List/ListItem.js @@ -23,6 +23,9 @@ const ListItemView = styled.div.attrs({ border-top: none; margin-top: 0; } + .sub-list &:nth-of-type(1) { + border-top: ${props => props.noBorder ? 'none' : '1px solid #f2f3f5'}; + } `; const TitleView = styled.div.attrs({ diff --git a/src/js/modules/videoDownload/UI/videoDownload.js b/src/js/modules/videoDownload/UI/videoDownload.js index 7ec0261..21238ad 100644 --- a/src/js/modules/videoDownload/UI/videoDownload.js +++ b/src/js/modules/videoDownload/UI/videoDownload.js @@ -508,7 +508,7 @@ export default () => { return ( 视频下载 - 切换清晰度 - 合并下载会先下载至内存最后弹出另存为窗口。当卡主时,请下载分段 + 合并下载会先下载至内存最后弹出另存为窗口。当卡住时,请下载分段 {loadedVideo && (loadedVideo.durl || loadedVideo.dash) && this.renderFLV()} {!videoData[currentCid] ? diff --git a/src/js/modules/videoDownload/index.js b/src/js/modules/videoDownload/index.js index 195d1e3..21d537d 100644 --- a/src/js/modules/videoDownload/index.js +++ b/src/js/modules/videoDownload/index.js @@ -134,7 +134,7 @@ export class VideoDownload extends Feature { const {filename: originFilename, cid} = filenameObject; const filename = originFilename.replace(/[|"*?:<>]/g, '_'); const targetData = _.find(responseHeaders, (o) => o.name === 'Content-Disposition'); - const nameValue = `attachment; filename="${encodeURIComponent(filename)}.${cid}.flv"; filename*=utf-8' '${encodeURIComponent(filename)}.${cid}.flv`.replace('/', '%2f'); + const nameValue = `attachment; filename="${encodeURIComponent(filename)}.${cid}.flv"; filename*="utf-8' '${encodeURIComponent(filename)}.${cid}.flv"`.replace('/', '%2f'); if (targetData) { targetData.value = nameValue; } else { diff --git a/src/js/modules/videoSubtitleDownload/UI/index.js b/src/js/modules/videoSubtitleDownload/UI/index.js index 771fbf4..43d861b 100644 --- a/src/js/modules/videoSubtitleDownload/UI/index.js +++ b/src/js/modules/videoSubtitleDownload/UI/index.js @@ -80,24 +80,24 @@ const UIBuilder = () => { chrome.runtime.sendMessage({command: 'videoSubtitleDownloadDOMInitialized'}); chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.command === 'loadSubtitle' && message.url) { - $.ajax({ + fetch(message.url, { + mode: 'cors', method: 'get', + referrer: window.location.href, headers: {'From': 'bilibili-helper'}, - url: message.url, - success: (res) => { - const regExpRes = /(.+)<\/subtitle>/.exec(res); - if (regExpRes.length > 0) { - const subtitleData = JSON.parse(regExpRes[1]).subtitles; - this.setState({subtitleData}); - } - }, - error: (e) => { - console.error(e); - if (e.status === 403) { - return; - } - }, - }); + credentials: "include", + }).then(res => res.text()).then(res => { + const regExpRes = /(.+)<\/subtitle>/.exec(res); + if (regExpRes.length > 0) { + const subtitleData = JSON.parse(regExpRes[1]).subtitles; + this.setState({subtitleData}); + } + }).catch((e) => { + console.error(e); + if (e.status === 403) { + return; + } + }) sendResponse(true); } }); diff --git a/src/js/pages/config/index.js b/src/js/pages/config/index.js index 3e20cda..bdf60f6 100644 --- a/src/js/pages/config/index.js +++ b/src/js/pages/config/index.js @@ -434,6 +434,8 @@ class PageConfig extends React.Component { ); }; + isEdge = () => window.navigator.userAgent.indexOf("Edg") > -1; + render() { const { // modal state @@ -477,8 +479,8 @@ class PageConfig extends React.Component {