edge fixes
This commit is contained in:
parent
4d3033f17c
commit
2a929c8de8
34
gulpfile.js
34
gulpfile.js
|
@ -282,6 +282,14 @@ gulp.task('dist:css', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('dist:js', function () {
|
gulp.task('dist:js', function () {
|
||||||
|
return distJs(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('dist:js:edge', function () {
|
||||||
|
return distJs(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
function distJs(edge) {
|
||||||
var appTask = gulp
|
var appTask = gulp
|
||||||
.src([
|
.src([
|
||||||
// models/scripts
|
// models/scripts
|
||||||
|
@ -303,7 +311,7 @@ gulp.task('dist:js', function () {
|
||||||
.src([
|
.src([
|
||||||
paths.libDir + 'jquery/jquery.js',
|
paths.libDir + 'jquery/jquery.js',
|
||||||
paths.libDir + 'bootstrap/js/bootstrap.js',
|
paths.libDir + 'bootstrap/js/bootstrap.js',
|
||||||
paths.libDir + 'angular/angular.js',
|
edge ? './src/edge/angular.js' : (paths.libDir + 'angular/angular.js'),
|
||||||
paths.libDir + '**/*.js',
|
paths.libDir + '**/*.js',
|
||||||
'!' + paths.libDir + 'q/**/*',
|
'!' + paths.libDir + 'q/**/*',
|
||||||
'!' + paths.libDir + 'tldjs/**/*',
|
'!' + paths.libDir + 'tldjs/**/*',
|
||||||
|
@ -314,7 +322,7 @@ gulp.task('dist:js', function () {
|
||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.'));
|
||||||
|
|
||||||
return merge(appTask, libTask);
|
return merge(appTask, libTask);
|
||||||
});
|
}
|
||||||
|
|
||||||
gulp.task('dist:preprocess', function () {
|
gulp.task('dist:preprocess', function () {
|
||||||
return gulp
|
return gulp
|
||||||
|
@ -326,12 +334,20 @@ gulp.task('dist:preprocess', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('dist', ['build'], function (cb) {
|
gulp.task('dist', ['build'], function (cb) {
|
||||||
|
return dist(false, cb);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('dist:edge', ['build'], function (cb) {
|
||||||
|
return dist(true, cb);
|
||||||
|
});
|
||||||
|
|
||||||
|
function dist(edge, cb) {
|
||||||
return runSequence(
|
return runSequence(
|
||||||
'dist:clean',
|
'dist:clean',
|
||||||
['dist:move', 'dist:css', 'dist:js'],
|
['dist:move', 'dist:css', edge ? 'dist:js:edge' : 'dist:js'],
|
||||||
'dist:preprocess',
|
'dist:preprocess',
|
||||||
cb);
|
cb);
|
||||||
});
|
}
|
||||||
|
|
||||||
var sidebarActionManifestObj = {
|
var sidebarActionManifestObj = {
|
||||||
"default_title": "bitwarden",
|
"default_title": "bitwarden",
|
||||||
|
@ -366,7 +382,7 @@ gulp.task('dist-opera', ['dist'], function (cb) {
|
||||||
return zipDist('dist-opera');
|
return zipDist('dist-opera');
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('dist-edge', ['dist'], function (cb) {
|
gulp.task('dist-edge', ['dist:edge'], function (cb) {
|
||||||
// move dist to temp extension folder
|
// move dist to temp extension folder
|
||||||
new Promise(function (resolve, reject) {
|
new Promise(function (resolve, reject) {
|
||||||
gulp.src(paths.dist + '**/*')
|
gulp.src(paths.dist + '**/*')
|
||||||
|
@ -403,14 +419,6 @@ gulp.task('dist-edge', ['dist'], function (cb) {
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}).then(function () {
|
|
||||||
// move custom angular build to dist libs
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
gulp.src('src/edge/angular.js')
|
|
||||||
.on('error', reject)
|
|
||||||
.pipe(gulp.dest(paths.dist + 'Extension/lib/angular'))
|
|
||||||
.on('end', resolve);
|
|
||||||
});
|
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
// move src edge folder to dist
|
// move src edge folder to dist
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
|
@ -24,7 +24,16 @@ angular
|
||||||
|
|
||||||
self.expandVault = function (e) {
|
self.expandVault = function (e) {
|
||||||
$analytics.eventTrack('Expand Vault');
|
$analytics.eventTrack('Expand Vault');
|
||||||
chrome.tabs.create({ url: $window.location.href });
|
|
||||||
|
var href = $window.location.href;
|
||||||
|
if (utilsService.isEdge()) {
|
||||||
|
var popupIndex = href.indexOf('/popup/');
|
||||||
|
if (popupIndex > -1) {
|
||||||
|
href = href.substring(popupIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
chrome.tabs.create({ url: href });
|
||||||
};
|
};
|
||||||
|
|
||||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||||
|
|
Loading…
Reference in New Issue