Pinterest with no registration modal popup

Allows to browse Pinterest without login/registration, removing the offending modal popup

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Pinterest with no registration modal popup
// @namespace   jesusmg
// @version     2.5
// @description Allows to browse Pinterest without login/registration, removing the offending modal popup
// @include     http://*.pinterest.com/*
// @include     https://*.pinterest.com/*
// @include     https://*.pinterest.*/*
// @author	    Jesús González
// @require     http://code.jquery.com/jquery-latest.min.js
// @require 		https://greasyfork.org/scripts/6250-waitforkeyelements/code/waitForKeyElements.js?version=23756
// ==/UserScript==

$(document).ready(function() { 
  setInterval(function() {
    if ($("div[data-reactcontainer='']").is(':empty')) {
  		console.log("Page is empty, reloading");
      location.reload();
		}
  }, 1000);
  
  
    waitForKeyElements (
  //"iframe[title='fb:login_button Facebook Social Plugin']", hideElement
  "iframe", removeElement  
  );

  waitForKeyElements (
    "div[data-test-id='signup']", removeElement
  );

  waitForKeyElements (
    "div[data-test-id='fullPageSignupModal']", removeElement
  );

  waitForKeyElements (
      "div[data-test-id='giftWrap']", removeElement
  );

  /*
  waitForKeyElements (
    ".FullPageModal__scroller", removeParent
  );
  */
});

function hideElement(jNode) {
	console.log("Hiding offending registration crap");
	console.log(jNode);  
  jNode.css('visibility', 'hidden');
  
}

function removeElement(jNode) {
	console.log("Removing offending registration crap");
	console.log(jNode);
  
  jNode.remove();
}

function removeParent(jNode) {
  removeElement(jNode.parent());
}

function removeElementDelayed(jNode) {
  setTimeout(removeElement(jNode), 3000);
}