
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
vue3-native-notification
Advanced tools
Vue.js 3 plugin for native notifications with composition API hook.
npm install --save vue3-native-notification
import { createApp } from 'vue'
import Vue3NativeNotification from 'vue3-native-notification'
const app = createApp()
app.use(VueNativeNotification, {
// Automatic permission request before
// showing notification (default: true)
requestOnNotify: true,
})
<template>
<button type="button" @click="notify">Show notification</button>
</template>
<script>
export default defineComponent({
name: 'SimpleComponent',
setup() {
const nativeNotification = useNativeNotification()
const notify = function () {
nativeNotification.show(
'Notification',
{
body: 'This is a simple notification',
},
{},
)
}
},
})
</script>
<style></style>
You can manually request users permission with:
// Global
app.notification.requestPermission().then(console.log) // Prints "granted", "denied" or "default"
// Component
//...
setup() {
const nativeNotification = useNativeNotification()
//...
nativeNotification.requestsPermission().then(console.log)
},
//...
https://developer.mozilla.org/en-US/docs/Web/API/Notification
We now supports all notifications events
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror
Is an empty function. Nothing will be executed
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick
When notification is clicked, we set the focus on the context browser and close the notification
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose
Is an empty function. Nothing will be executed
https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow
Is an empty function. Nothing will be executed
const notification = {
title: 'Your title',
options: {
body: 'This is an example!',
},
events: {
onerror: function () {
console.log('Custom error event was called')
},
onclick: function () {
console.log('Custom click event was called')
},
onclose: function () {
console.log('Custom close event was called')
},
onshow: function () {
console.log('Custom show event was called')
},
},
}
this.$notification.show(
notification.title,
notification.options,
notification.events,
)
FAQs
Vue.js 3 plugin for native notifications
The npm package vue3-native-notification receives a total of 1,004 weekly downloads. As such, vue3-native-notification popularity was classified as popular.
We found that vue3-native-notification demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.