Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function saveProductInformation() {
- var excludeList = [ "apple", "smartphone", "consolegames", "scruples" ];
- var productFullTitle = document.querySelector('h1.product-title');
- var productName = document.querySelector('h1.product-title .product-name');
- var isProductValid = true;
- excludeList.forEach(item => {
- if (window.location.href.indexOf(item) != -1) {
- isProductValid = false;
- }
- });
- if (productFullTitle && productName && isProductValid) {
- window.localStorage.setItem('adoricLastVisitedProductName', productName.textContent);
- window.localStorage.setItem('adoricLastVisitedProductLink', window.location.href);
- }
- }
- saveProductInformation();
- setTimeout(saveProductInformation, 3000);
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement