paywallr/lib.js

24 lines
822 B
JavaScript
Raw Normal View History

2020-03-14 20:33:36 +01:00
// ____
// __ _____ ___ ___ ___ ___ _____ _/ / /
// / // / _ \/ _ \/ _ `/ // / |/|/ / _ `/ / /
// \_,_/_//_/ .__/\_,_/\_, /|__,__/\_,_/_/_/
// /_/ /___/
//
// standard library
// github.com/tobimori/unpaywall
//
2020-03-16 15:43:07 +01:00
// browser detection by rob-w on stackoverflow
2020-03-16 14:59:29 +01:00
// Firefox
const isFirefox = typeof InstallTrigger !== 'undefined';
// Chrome
const isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime);
2020-03-14 22:24:58 +01:00
// orginally written by Lukas Fruntke
2020-03-14 20:33:36 +01:00
// https://github.com/tobimori/unpaywall-funke/unpaywall-funke.user.js
const removeElements = (...arrays) => {
[...arrays].forEach(([...array]) => array.filter(n => !!n)
.forEach(n => n.remove())
);
2020-03-15 19:21:04 +01:00
};