New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

electron-retain-webview-scroll

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-retain-webview-scroll - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

21

lib/ScrollTracker.js

@@ -22,3 +22,3 @@ /**

ScrollTracker.prototype.forward = function() {
ScrollTracker.prototype.forward = function () {
this.index += 1;

@@ -31,3 +31,3 @@ if (this.index >= this.details.length) {

ScrollTracker.prototype.back = function() {
ScrollTracker.prototype.back = function () {
if (this.index > 0) this.index -= 1;

@@ -37,9 +37,11 @@ this.motion = NAVTYPE.BACK;

ScrollTracker.prototype.reload = function() {
ScrollTracker.prototype.reload = function () {
this.motion = NAVTYPE.RELOAD;
};
ScrollTracker.prototype.setScrollPosition = function(position) {
ScrollTracker.prototype.setScrollPosition = function (position) {
try {
this.details[this.index].position = position;
if (this.index >= 0 && this.details[this.index]) {
this.details[this.index].position = position;
}
} catch (e) {

@@ -50,5 +52,6 @@ throw Error(`Unable to set scroll position:\n${e}`);

ScrollTracker.prototype.getScrollPosition = function() {
ScrollTracker.prototype.getScrollPosition = function () {
try {
let position = this.details[this.index].position;
let position =
this.details[this.index] && this.details[this.index].position;
return position ? position : { x: 0, y: 0 };

@@ -61,3 +64,3 @@ } catch (e) {

ScrollTracker.prototype.didNavigate = function(url) {
ScrollTracker.prototype.didNavigate = function (url) {
if (this.motion === NAVTYPE.NEW_PAGE) {

@@ -72,3 +75,3 @@ this.index += 1;

ScrollTracker.prototype.didScroll = function(position) {
ScrollTracker.prototype.didScroll = function (position) {
this.setScrollPosition(position);

@@ -75,0 +78,0 @@ };

{
"name": "electron-retain-webview-scroll",
"version": "1.0.3",
"version": "1.0.4",
"description": "Manage scrolling of content inside an Electron webview element.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc