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

BrowserSync Notify #538

Closed
NgYueHong opened this issue Mar 27, 2015 · 9 comments · Fixed by luismayta/example-django-sales#22
Closed

BrowserSync Notify #538

NgYueHong opened this issue Mar 27, 2015 · 9 comments · Fixed by luismayta/example-django-sales#22
Assignees

Comments

@NgYueHong
Copy link

I hope that the notify setting can be upgraded to be able to disable default message but still can display specially requested to notify message.

I personally found that every time when page reload, it shows "Connected to BrowserSync" is very annoying, but I want to be able to display custom message from gulp when needed. Currently when the notify is disabled, the custom message will also not displayed as well.

Hope there will be an upgrade for this soon. Thank you.

@shakyShane
Copy link
Contributor

@NgYueHong - the convention in other areas of the api is to have an override option.

I propose

var bs1  = require("browser-sync").create();

bs1.init({
    server: "./app",
    notify: false
});

// later in your code...
bs1.notify("Compiling templates, please wait...", {override: true});

@shakyShane
Copy link
Contributor

browser-sync@2.6.9 will work as expected.

var bs1  = require("browser-sync").create();

bs1.init({
    server: "./app",
    notify: false
});

bs1.watch('./app/*.css').on('change', function (file) {
    bs1.notify(file + ' changed');
});

@NgYueHong
Copy link
Author

Great! Thanks a lot for your great work.

@olets
Copy link

olets commented Apr 9, 2016

@shakyShane I'm running some compilation, and then trigger browserSynch.reload(). Trying to set up a (file + 'changed')-type notification, but can't figure out where to build it in. The basic idea is

var browserSync = require('browser-sync');
gulp.task('browser-sync', function() {
    browserSync.init({
        server: {
            baseDir: 'compiled/'
        }
    })
});
gulp.task('browser-sync:reload', function () {
    browserSync.reload();  
});
// more tasks that call browser-sync:reload

How would this work?

@AlexGalays
Copy link

AlexGalays commented Sep 10, 2016

I can't see any custom notifications if notify = false with @2.15.0

@cmalven
Copy link

cmalven commented Feb 13, 2017

I'm having the same issue in 2.18.7. bs.notify() doesn't show anything if notify: false is in the config.

@shakyShane shakyShane self-assigned this Feb 13, 2017
@shakyShane shakyShane added the bug label Feb 13, 2017
shakyShane added a commit to BrowserSync/browser-sync-client that referenced this issue Feb 13, 2017
shakyShane added a commit that referenced this issue Feb 13, 2017
This will allow manual calls to `.notify()`

fixes #538
@shakyShane
Copy link
Contributor

Fixed - will be released at some point today

This was referenced Feb 13, 2017
@hlolli
Copy link

hlolli commented Jun 14, 2018

I'm on 2.23.6 if I do notify: false, I can't in any way send notifications, with or without override: true.

@mathisonian
Copy link

I'm seeing the same issue as @hlolli in 2.26.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment