Skip to content

Instantly share code, notes, and snippets.

@gemp
Last active January 30, 2018 00:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gemp/c88ff33c6e81e472c88d4d9b0025082c to your computer and use it in GitHub Desktop.
Save gemp/c88ff33c6e81e472c88d4d9b0025082c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name ASI beta
// @version 0.7
// @description On se refait pas
// @author gemp
// @match https://beta.arretsurimages.net/*
// @updateURL https://gist.github.com/gemp/c88ff33c6e81e472c88d4d9b0025082c/raw/beta-asi.user.js
// @downloadURL https://gist.github.com/gemp/c88ff33c6e81e472c88d4d9b0025082c/raw/beta-asi.user.js
// @grant none
// ==/UserScript==
(function() {
var oups = function() {
var fini = localStorage.getItem('gemp-beta') == null;
var href = document.location.href;
if (href.match('comments=open') && fini) {
var str = "<h1>INFORMATION</h1>" +
"<p>Il semble que ma <b>mini-extension</b> cause plus de problèmes qu'elle n'en résout, " +
"notamment certains bugs qui ne seraient apparemment pas directement dus au site.</p>" +
"<p>Je me vois dans l’obligation de la désactiver, à la demande expresse d'ASI. " +
"Je n’ai pas vraiment d’autre solution à proposer, il va effectivement falloir être patient.</p>" +
"<p>Avec mes excuses,<br><i>gemp</i></p>";
var msg = $('<div class="fini"><p><a href="#">Ne plus afficher ce message</a></p></div>').click(function(e) {
e.preventDefault();
localStorage.setItem('gemp-beta', true);
$('.fini').hide(1000);
return false;
}).prepend(str)
.find('p').css('margin-top', '10px').end()
.find('h1').css({marginTop: '20px', fontSize: '3rem', color: '#7B58D4'}).end();
$('.comments-panel-side-menu-inner').append(msg);
}
};
window.check = setTimeout(oups, 4000);
// Note: je ne pense pas que les plantages soient la faute de cette extension, mais bon...
// et je vais personnellement continuer à l'utiliser.
})();
@gemp
Copy link
Author

gemp commented Jan 29, 2018

version 0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment