
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
qr-scanner-maa
Advanced tools
Based on code-kotis/qr-code-scanner
QR scanner frame to embed to your project as an iframe. You can communicate with it using postMessage
. You can switch cameras. Fallback to single image if streaming is not supported.
Switch camera
Fallback to single image scan
Encapsulated logic in iframe and communicate with it through postMessage
Listen for scan results and other events through window.addEventListener
git clone https://github.com/maa105/qr-code-scanner
npm install
npm run start
npm run build
Move dist folder to your app and use the index.html
in your app as src of iframe
communicate with iframe through:
6.1. listen to events:
window.addEventListener('message', (message) => {
if(message.data.event === 'scan-result') {
console.log('Scan Result: ', message.data.result);
}
else if(message.data.event === 'init-status') {
if(message.data.streaming) {
console.log('Cameras available:', message.data.devices);
console.log('Selected camera:', message.data.devices[message.data.selected]);
}
else {
console.log('Fallback use postMessage { command: "scan" }');
}
}
else if(message.data.event === 'next-device-result') {
if(message.data.success) {
console.log('Cameras available:', message.data.devices);
console.log('Selected camera:', message.data.devices[message.data.selected]);
}
else {
console.log('OOPS');
}
}
});
6.2. send commands through postMessage
document.getElementById('qr-scanner-frame').contentWindow.postMessage({
command: 'next-device'
});
// only use incase streaming is false
document.getElementById('qr-scanner-frame').contentWindow.postMessage({
command: 'scan'
});
FAQs
qr scanner frame to include in your app as iframe
We found that qr-scanner-maa 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.