Registry / web-framework / vue-browserupdate

vue-browserupdate

JSON →
library1.2.0jsnpmunverified

`vue-browserupdate` is a Vue.js wrapper for the popular `browser-update.org` JavaScript library, designed to streamline the integration of browser version checking and update prompting into Vue applications. It provides a straightforward API to initialize the underlying `browser-update` script and exposes its core events—`onshow`, `onclick`, and `onclose`—as Vue-compatible functions. The current stable version, 1.2.0, indicates a mature wrapper for Vue 2 applications. Its release cadence typically follows updates to the core `browser-update` library or significant changes within the Vue.js ecosystem. The package's primary differentiator is its simplicity in encapsulating the browser update notification logic within a standard Vue plugin pattern, minimizing boilerplate for developers.

npm install vue-browserupdate
INSTALL
IMPORT
SIG · VUE-BROWSERUPDATE
V
vue-browserupdate
web-frameworkjavascriptv1.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VueBrowserUpdate
import VueBrowserUpdate from 'vue-browserupdate';
const VueBrowserUpdate = require('vue-browserupdate');
The primary import for installing the plugin in a Vue 2 application using `Vue.use()`.
Vue.browserUpdate.onshow
Vue.browserUpdate.onshow(() => { /* ... */ });
import { onshow } from 'vue-browserupdate';
These event handlers (onshow, onclick, onclose) are attached directly to the global `Vue.browserUpdate` object after the plugin is installed, not as named exports.

Demonstrates how to install `vue-browserupdate` as a Vue plugin, pass custom options to the underlying `browser-update` library, enable test mode, and attach event listeners to the browser update prompt.

import Vue from 'vue'; import VueBrowserUpdate from 'vue-browserupdate'; // Install the plugin with custom options Vue.use(VueBrowserUpdate, { options: { container: document.body, required: { e: -2, f: -2, o: -2, s: -2, c: -2 }, // Example: Require latest 2 versions text: 'Your browser is outdated. Please update to improve your experience and security.', // Full options: http://browser-update.org/customize.html }, test: true, // Enable test mode to always show the prompt }); // Attach event listeners (optional) Vue.browserUpdate.onshow(() => { console.log('The browser update modal is visible.'); }); Vue.browserUpdate.onclick(() => { console.log('The update link was clicked.'); }); Vue.browserUpdate.onclose(() => { console.log('The update modal was closed.'); }); // Basic Vue app setup new Vue({ el: '#app', template: '<div><h1>My App</h1><p>Browser update prompt will show if conditions met.</p></div>' });
Debug
Known issues
gotchaThe `test: true` option forces the browser update prompt to appear regardless of the browser version, which is useful for development and testing but should be removed or set to `false` for production deployments.
fix
Remove `test: true` or set it to `false` in production build configurations.
affects: >=1.0.0
gotchaAll configuration for the underlying `browser-update` library must be passed within the `options` key of the plugin's configuration object, e.g., `Vue.use(VueBrowserUpdate, { options: { /* ... */ } })`.
fix
Ensure all `browser-update.org` specific configurations are nested under the `options` property when calling `Vue.use()`.
affects: >=1.0.0
gotchaThis wrapper is primarily designed for Vue 2 applications using the global Vue instance. Its direct usage patterns (`Vue.use`, `Vue.browserUpdate`) are not directly compatible with Vue 3's `createApp` instance-based plugin registration without additional shims or refactoring.
fix
For Vue 3, consider using a different `browser-update` integration or creating a custom plugin that adapts this wrapper's logic to Vue 3's `app.use()` and `app.config.globalProperties`.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Vue.use is not a function
Attempting to call `.use()` on an undefined or incorrect Vue object, or Vue is not globally available/imported correctly.
fix
Ensure `import Vue from 'vue';` is present and that `Vue.use(VueBrowserUpdate)` is called after Vue itself is properly loaded and initialized.
TypeError: Cannot read properties of undefined (reading 'onshow')
The `Vue.browserUpdate` object, which contains the event handler methods, is accessed before the `vue-browserupdate` plugin has been installed via `Vue.use()`.
fix
Verify that `Vue.use(VueBrowserUpdate)` is called before any attempts to access `Vue.browserUpdate.onshow`, `onclick`, or `onclose`.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
browser-updaterequiredProvides the core browser detection and update prompting functionality.
vuerequiredRequired runtime peer dependency as this is a Vue.js plugin.
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
vue-browserupdate — npm install vue-browserupdate · libregistry