shlsdv / Gelbooru - Display all site content

// ==UserScript==
// @name        Gelbooru - Display all site content
// @namespace   Violentmonkey Scripts
// @match       https://gelbooru.com/*
// @grant       none
// @version     1.1
// @author      shlsdv
// @license     MIT
// @description Enables "Display All Site Content" by default. Try reloading the page if it doesn't show immediately.
// ==/UserScript==



function getCookie(name) {
  var cookies = document.cookie.split(';');
  for (var i = 0; i < cookies.length; i++) {
    var cookie = cookies[i].trim();
    if (cookie.startsWith(name + '=')) {
      return cookie.substring(name.length + 1);
    }
  }
  return null;
}

function setCookie(name, value, days) {
  var expires = '';
  if (days) {
    var date = new Date();
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    expires = '; expires=' + date.toUTCString();
  }
  document.cookie = name + '=' + value + expires + '; path=/';
}

if (!getCookie('fringeBenefits')) {
  setCookie('fringeBenefits', 'yup');
}