Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warnning when browser is not support #703

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/browser/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function getHeader(headers, name) {
return headers[name] || headers[name.toLowerCase()];
}

function _unSupportBrowserTip() {
const { name, version } = platform;
if (name.toLowerCase() === 'ie' && version.split('.')[0] < 10) {
// eslint-disable-next-line no-console
console.warn('ali-oss does not support the current browser');
}
}
// check local web protocol,if https secure default set true , if http secure default set false
function isHttpsWebProtocol() {
// for web worker not use window.location.
Expand All @@ -33,6 +40,7 @@ function isHttpsWebProtocol() {
}

function Client(options, ctx) {
_unSupportBrowserTip();
if (!(this instanceof Client)) {
return new Client(options, ctx);
}
Expand Down