
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
@netless/app-presentation
Advanced tools
A Netless App that display multiple images as presentation slides.
npm add @netless/app-presentation
import { register } from "@netless/fastboard"
import { install } from "@netless/app-presentation"
install(register, {
as: 'DocsViewer',
appOptions: {
// Enable scrollbar feature
useScrollbar: true,
// Enable clip view feature, only show page content area
useClipView: true,
// Scrollbar event callbacks
scrollbarEventCallback: {
onScrollCameraUpdated: (appid, originScale, scale) => {
console.log('Camera scale updated', appid, scale)
},
onScrollbarDragEnd: () => {
console.log('Scrollbar drag ended')
}
}
}
})
Call fastboard.insertDocs()
if you installed this app { as: 'DocsViewer' }.
// Assume you have got the presentation pages as such data structure
const data = [
// The [preview] field is optional
{ width: 1024, height: 768, url: 'url/to/1.png', preview: 'url/to/1.small.png' },
]
// Now call addApp()
fastboard.manager.addApp({
kind: 'Presentation',
options: {
// folder name to mount whiteboard scenes
// the same folder name will prevent you from insterting it again
scenePath: `/presentation/foo`,
// app window title
title: 'a.pdf',
// whiteboard scenes specification
scenes: data.map((e, i) => ({
name: String(i + 1),
ppt: {
src: e.url,
width: e.width,
height: e.height,
previewURL: e.preview
}
}))
}
})
Note that if you do not replace the DocsViewer app with { as: 'DocsViewer' },
the dispatchDocsEvent()
function won't work on the Presentation app. This is because that function only
handles app whose kind is DocsViewer or Slide.
useScrollbarEnable scrollbar feature, providing horizontal and vertical scrollbars for navigation and viewing presentations.
install(register, {
as: 'DocsViewer',
appOptions: {
useScrollbar: true,
scrollbarEventCallback: {
onScrollCameraUpdated: (appid, originScale, scale) => {
// Triggered when camera scale is updated
},
onScrollbarDragEnd: () => {
// Triggered when scrollbar drag ends
}
}
}
})
useClipViewEnable clip view feature, only show page content area, hide content outside the whiteboard area.
install(register, {
as: 'DocsViewer',
appOptions: {
useClipView: true
}
})
screenshotCurrentPageAsync(context, width?, height?)Asynchronously screenshot the current page to Canvas context. Supports custom width and height.
const app = fastboard.manager.queryOne(appId)
if (app && app.kind === 'DocsViewer') {
const controller = app.appResult
const canvas = document.createElement('canvas')
const { width, height } = controller.getPageSize()
canvas.width = width
canvas.height = height
const ctx = canvas.getContext('2d')
if (ctx) {
await controller.screenshotCurrentPageAsync(ctx, width, height)
// Use canvas for subsequent operations, such as exporting images
canvas.toBlob((blob) => {
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = 'screenshot.png'
a.click()
})
}
}
getPageSize()Get the size (width and height) of the current page.
const app = fastboard.manager.queryOne(appId)
if (app && app.kind === 'DocsViewer') {
const controller = app.appResult
const { width, height } = controller.getPageSize()
console.log(`Current page size: ${width}x${height}`)
}
To only develop the UI part, run:
$ pnpm build
$ pnpm dev
Then goto http://localhost:5173/ to see the app locally.
To develop it in a real whiteboard room, add a file .env.local containing the room's uuid and token, then goto http://localhost:5173/e2e/.
MIT @ netless
FAQs
Netless App for presentation slides (images)
We found that @netless/app-presentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.