Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
electron-retain-webview-scroll
Advanced tools
Manage scrolling of content inside an Electron webview element.
Electron Scroller is a package designed to manage scrolling of historical pages
in <webview>
tags. Webviews in electron manage page history, offering forward
and back, but when navigating to the pages, the scroll position is lost. This
package allows you to maintain the scroll position and automatically reposition
the page to the proper scroll position upon navigation (back, forward, reload).
To install Electron Scroller, use npm. The preferred method is to install Electron Scroller as an dependency in your app:
npm install --save electron-scroller
It is necessary to include Electron Scroller in two places in your app:
<script>
in the HTML source)<webview preload="file.js"
)<!DOCTYPE html>
<html>
<head>
<title>Browser</title>
</head>
<body>
<div id="buttonBar">
...
</div>
<div id="browser">
<webview id="browserView" preload="preload.js"></webview>
</div>
<script src="browser.js"></script>
</body>
</html>
Require the package and use the add()
method. Pass to add()
a string
containing a single
CSS selector
that describes the specific webview to be managed. If only a single webview
exists, the selector is not required. Because the Scroller hooks
into the methods of the webview, it may be best to call add()
early in the
process and before configuring the webview. In this example, in the file
browser.js
:
const scroller = require('electron-scroller')
onload = function() {
let selector = '#browserView'
scroller.add(selector)
// The selector is not required if there is only a single webview:
// scroller.add()
}
The Scroller has to be included in the preload file by calling the preload()
method. It is not necessary to pass the selector. In this example, in the file
preload.js
:
require('electron-scroller').preload()
FAQs
Manage scrolling of content inside an Electron webview element.
The npm package electron-retain-webview-scroll receives a total of 2 weekly downloads. As such, electron-retain-webview-scroll popularity was classified as not popular.
We found that electron-retain-webview-scroll 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.