angularjs - Avoid cross browser action in Gulp -


i have created gulp file project, gets run when open in 2 browsers , scroll page in 1 browser or type reflected in browser also. don't know what's wrong.

here gulp.js file

var gulp = require('gulp'), plumber = require('gulp-plumber'), rename = require('gulp-rename'); var autoprefixer = require('gulp-autoprefixer'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var imagemin = require('gulp-imagemin'), cache = require('gulp-cache'); var minifycss = require('gulp-minify-css'); var browsersync = require('browser-sync');  gulp.task('browser-sync', function() {     browsersync({        server: {            basedir: "./",         }     });  });   gulp.task('bs-reload', function () {     browsersync.reload();  });  gulp.task('images', function(){    gulp.src('assets/images/**/*')    .pipe(cache(imagemin({ optimizationlevel: 3, progressive: true,          interlaced: true })))     .pipe(gulp.dest('build/images/')); });  gulp.task('styles', function(){    gulp.src(['assets/styles/**/*.css'])    .pipe(plumber({       errorhandler: function (error) {       console.log(error.message);       this.emit('end');  }})) //.pipe(sass()) .pipe(autoprefixer('last 2 versions')) .pipe(gulp.dest('build/styles/')) .pipe(rename({suffix: '.min'})) .pipe(minifycss()) .pipe(gulp.dest('build/styles/')) .pipe(browsersync.reload({stream:true})) });  gulp.task('scripts', function(){   return gulp.src('app/**/*.js')     .pipe(plumber({        errorhandler: function (error) {        console.log(error.message);        this.emit('end'); }})) .pipe(concat('main.js')) .pipe(gulp.dest('build/js/')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(gulp.dest('build/js/')) .pipe(browsersync.reload({stream:true})) });   gulp.task('default', ['browser-sync'], function(){      gulp.watch("assets/styles/**/*.css", ['styles']);      gulp.watch("app/**/*.js", ['scripts']);      gulp.watch("*.html", ['bs-reload']);  });    gulp.task('production', ['browser-sync','bs-  reload','images','styles','scripts','default']); 

i got solution question. use "ghostmode: false" avoid cross browser action.for changes scroll in 1 browser scroll page in browser has opened page.

gulp.task('browser-sync', function() {    browsersync({       server: {           basedir: "./",        },        ghostmode : false    }); }); 

thanks,

suriya


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -