1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

edge fixes

This commit is contained in:
Kyle Spearrin 2017-10-05 17:18:54 -04:00
parent 4d3033f17c
commit 2a929c8de8
2 changed files with 31 additions and 14 deletions

View File

@ -282,6 +282,14 @@ gulp.task('dist:css', function () {
});
gulp.task('dist:js', function () {
return distJs(false);
});
gulp.task('dist:js:edge', function () {
return distJs(true);
});
function distJs(edge) {
var appTask = gulp
.src([
// models/scripts
@ -303,7 +311,7 @@ gulp.task('dist:js', function () {
.src([
paths.libDir + 'jquery/jquery.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 + 'q/**/*',
'!' + paths.libDir + 'tldjs/**/*',
@ -314,7 +322,7 @@ gulp.task('dist:js', function () {
.pipe(gulp.dest('.'));
return merge(appTask, libTask);
});
}
gulp.task('dist:preprocess', function () {
return gulp
@ -326,12 +334,20 @@ gulp.task('dist:preprocess', function () {
});
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(
'dist:clean',
['dist:move', 'dist:css', 'dist:js'],
['dist:move', 'dist:css', edge ? 'dist:js:edge' : 'dist:js'],
'dist:preprocess',
cb);
});
}
var sidebarActionManifestObj = {
"default_title": "bitwarden",
@ -366,7 +382,7 @@ gulp.task('dist-opera', ['dist'], function (cb) {
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
new Promise(function (resolve, reject) {
gulp.src(paths.dist + '**/*')
@ -403,14 +419,6 @@ gulp.task('dist-edge', ['dist'], function (cb) {
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 () {
// move src edge folder to dist
return new Promise(function (resolve, reject) {

View File

@ -24,7 +24,16 @@ angular
self.expandVault = function (e) {
$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) {