Customize and test

Test the script

If you open your website with #test-bu appended to the url, the bar will always show up. Example: http://browser-update.org/#test-bu. Make sure the page is properly reloaded by opening the url in an new browser tab.

Append #ignorecookie-bu to test the detection. This will only show the bar in browsers configured to be outdated. It will ignore the cookie set to show the notification only once a day and show the notification every time you load the page.

Options

The following options can be passed to the script:

$buoop = {
notify: {i:8,f:25,o:17,s:9,c:22},
// Specifies browser versions to notify. Negative numbers specify how much versions behind current version to notify.
// f:22 ---> Firefox <= 22
// c:-5 ---> Chrome <= 35 if current Chrome version is 40.
// more info
reminder: 24,
// after how many hours should the message reappear
// 0 = show all the time
reminderClosed: 150,
// if the user explicitly closes message it reappears after x hours
onshow: function(infos){},
onclick: function(infos){},
onclose: function(infos){},
// callback functions after notification has appeared / was clicked / closed
l: false,
// set a fixed language for the message, e.g. "en". This overrides the default detection.
test: false,
// true = always show the bar (for testing)
text: "",
// custom notification text (html)
// Placeholders {brow_name} will be replaced with the browser name, {up_but} with contents of the update link tag and {ignore_but} with contents for the ignore link.
// Example: Your browser, {brow_name}, is too old: <a{up_but}>update</a> or <a{ignore_but}>ignore</a>.
text_xx: "",
// custom notification text for language "xx"
// e.g. text_de for german and text_it for italian
newwindow: true,
// open link in new window/tab
url: null,
// the url to go to after clicking the notification
noclose:false,
// Do not show the "ignore" button to close the notification
nomessage: false,
// Do not show a message if the browser is out of date, just call the onshow callback function
jsshowurl: "//browser-update.org/update.show.min.js",
// URL where the script, that shows the notification, is located. This is only loaded if the user actually has an outdated browser.
container: document.body,
// DOM Element where the notification will be injected.
style: "top"
// The position where the notification should be shown. Available options are:"top", "bottom", "corner"
no_permanent_hide: false
// Do not give the user the option to permanently hide the notification
api: xxx
// This is the version of the browser-update api to use. Please do not remove.
};

Change the style

The following CSS rules are applied by the notification. You can overwrite them in your own CSS. To do so you need to add some more specificity to the css-rules: e.g. body .buorg {font-size:20px}