Aftenposten read limit remover

Lets you read Aftenposten.no for free

  1. // ==UserScript==
  2. // @name Aftenposten read limit remover
  3. // @namespace Danielv123
  4. // @version 1.0
  5. // @description Lets you read Aftenposten.no for free
  6. // @author You
  7. // @match http://www.aftenposten.no/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11.  
  12. function eraseCookie (cookieName) {
  13. //--- ONE-TIME INITS:
  14. //--- Set possible domains. Omits some rare edge cases.?.
  15. var domain = document.domain;
  16. var domain2 = document.domain.replace (/^www\./, "");
  17. var domain3 = document.domain.replace (/^(\w+\.)+?(\w+\.\w+)$/, "$2");;
  18.  
  19. //--- Get possible paths for the current page:
  20. var pathNodes = location.pathname.split ("/").map ( function (pathWord) {
  21. return '/' + pathWord;
  22. } );
  23. var cookPaths = [""].concat (pathNodes.map ( function (pathNode) {
  24. if (this.pathStr) {
  25. this.pathStr += pathNode;
  26. }
  27. else {
  28. this.pathStr = "; path=";
  29. return (this.pathStr + pathNode);
  30. }
  31. return (this.pathStr);
  32. } ) );
  33.  
  34. ( eraseCookie = function (cookieName) {
  35. //--- For each path, attempt to delete the cookie.
  36. cookPaths.forEach ( function (pathStr) {
  37. //--- To delete a cookie, set its expiration date to a past value.
  38. var diagStr = cookieName + "=" + pathStr + "; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
  39. document.cookie = diagStr;
  40.  
  41. document.cookie = cookieName + "=" + pathStr + "; domain=" + domain + "; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
  42. document.cookie = cookieName + "=" + pathStr + "; domain=" + domain2 + "; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
  43. document.cookie = cookieName + "=" + pathStr + "; domain=" + domain3 + "; expires=Thu, 01-Jan-1970 00:00:01 GMT;";
  44. } );
  45. } ) (cookieName);
  46. }
  47. var cookieList = document.cookie.split (/;\s*/);
  48.  
  49. for (var J = cookieList.length - 1; J >= 0; --J) {
  50. var cookieName = cookieList[J].replace (/\s*(\w+)=.+$/, "$1");
  51.  
  52. eraseCookie (cookieName);
  53. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址