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

mpa-enhancer

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mpa-enhancer - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

2

docs/todo/js/lib/mpa.js

@@ -30,3 +30,3 @@ // @ts-check

w.addEventListener('beforeunload', () => {
w.addEventListener('unload', () => {
let data = getData() || {}

@@ -33,0 +33,0 @@ let persistedPages = new Set(data.__ || [])

{
"name": "mpa-enhancer",
"version": "2.2.0",
"version": "2.2.1",
"description": "Minimalist JavaScript to make your MPA work that much better",

@@ -5,0 +5,0 @@ "bugs": {

@@ -53,2 +53,6 @@ # MPA Enhancer

**2.2.1**
Fixed not working on Firefox and switched from even `beforeunload` to `unload`.
**2.2.0**

@@ -55,0 +59,0 @@

@@ -30,3 +30,3 @@ // @ts-check

w.addEventListener('beforeunload', () => {
w.addEventListener('unload', () => {
let data = getData() || {}

@@ -33,0 +33,0 @@ let persistedPages = new Set(data.__ || [])

@@ -1,1 +0,1 @@

(()=>{let a=document,l=window,u=a.querySelector.bind(a);function o(e,t){return e?.hasAttribute(t)}function s(){let e=a.body.getAttribute("mpa-page-name");return e||new URL(a.location.href).pathname.replace(/\/$/,"")}let d=null;l.addEventListener("click",e=>{d=e.target}),l.addEventListener("beforeunload",()=>{let e=f()||{},t=new Set(e.__||[]),n=s();o(a.body,"mpa-persist")&&(t.add(n),e.__=Array.from(t));for(let i in Object.keys(e))t.has(i)||i==="__"||delete e[i];let c=a.activeElement,r=a.activeElement===a.body?d:c;e[n]={y:l.scrollY,height:a.body.scrollHeight,active:{id:r?.id,name:r?.getAttribute("name")}},localStorage.pageLocations=JSON.stringify(e)});function p(){if(u("[autofocus]"))return;let e=f(s());if(!e)return;let{y:t,height:n,active:{id:c,name:r}}=e,i=a.getElementById(c)||u(`[name="${r}"]`);o(i,"mpa-skip-focus")||(g("focus",i),g("select",i)),!o(a.body,"mpa-skip-scroll")&&t&&l.scrollTo({top:t+a.body.scrollHeight-n})}function g(e,t){t&&t[e]&&t[e]()}function f(e){let t=localStorage.pageLocations;return t=t&&JSON.parse(t),e==null?t:t&&t[e]}p()})();
(()=>{let a=document,l=window,u=a.querySelector.bind(a);function o(e,t){return e?.hasAttribute(t)}function s(){let e=a.body.getAttribute("mpa-page-name");return e||new URL(a.location.href).pathname.replace(/\/$/,"")}let d=null;l.addEventListener("click",e=>{d=e.target}),l.addEventListener("unload",()=>{let e=f()||{},t=new Set(e.__||[]),n=s();o(a.body,"mpa-persist")&&(t.add(n),e.__=Array.from(t));for(let i in Object.keys(e))t.has(i)||i==="__"||delete e[i];let c=a.activeElement,r=a.activeElement===a.body?d:c;e[n]={y:l.scrollY,height:a.body.scrollHeight,active:{id:r?.id,name:r?.getAttribute("name")}},localStorage.pageLocations=JSON.stringify(e)});function p(){if(u("[autofocus]"))return;let e=f(s());if(!e)return;let{y:t,height:n,active:{id:c,name:r}}=e,i=a.getElementById(c)||u(`[name="${r}"]`);o(i,"mpa-skip-focus")||(g("focus",i),g("select",i)),!o(a.body,"mpa-skip-scroll")&&t&&l.scrollTo({top:t+a.body.scrollHeight-n})}function g(e,t){t&&t[e]&&t[e]()}function f(e){let t=localStorage.pageLocations;return t=t&&JSON.parse(t),e==null?t:t&&t[e]}p()})();
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