- Admin
- Mensagens : 2
Data de inscrição : 02/09/2016
Bloquear todas imagens
2/9/2016, 17:38
nesse vcs podem colocar mensagens motivacionais, etc.(fonte do script https://github.com/kevinselwyn/cats)
https://gist.github.com/nwangyu/1340547
troca tudo por gatinhos
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
- Código:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
var main = function($) {
var self = $.nCage = new function(){};
$.extend(self, {
nCageImgs : [
'aqui vocês colocam suas images',
' exemplo ',
'http://exemplo.com',
],
handleImages : function (lstImgs, time)
{
$.each($('img'), function(i,item) {
//Skip if image is already replaced
if($.inArray($(item).attr('src'), lstImgs) == -1)
{
var h = $(item).height();
var w = $(item).width();
//If image loaded
if(h > 0 && w > 0)
{
//Replace
$(item).css('width', w + 'px').css('height', h + 'px');
$(item).attr('src', lstImgs[Math.floor(Math.random() * lstImgs.length)]);
}
else
{
//Replace when loaded
$(item).load(function(){
//Prevent 'infinite' loop
if($.inArray($(item).attr('src'), lstImgs) == -1)
{
var h = $(item).height();
var w = $(item).width();
$(item).css('width', w + 'px').css('height', h + 'px');
$(item).attr('src', lstImgs[Math.floor(Math.random() * lstImgs.length)]);
}
});
}
}
});
//Keep replacing
if(time > 0)
setTimeout(function(){self.handleImages(lstImgs, time);},time);
}
});
//Run on jQuery ready
$(function(){
self.handleImages(self.nCageImgs, 3000);
});
};
//Method to load jQuery
function loadJS(src, callback) {
var s = document.createElement('script');
s.src = src;
s.async = true;
s.onreadystatechange = s.onload = function() {
var state = s.readyState;
if (!callback.done && (!state || /loaded|complete/.test(state))) {
callback.done = true;
callback();
}
};
document.getElementsByTagName('head')[0].appendChild(s);
}
//Add jQuery if not present, then run main
if(typeof jQuery == 'undefined') {
loadJS(('https:' == document.location.protocol ? 'https://' : 'http://') + 'ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js', function(){
jQuery.noConflict();
main(jQuery);
});
}else {
main(jQuery);
}
})();
https://gist.github.com/nwangyu/1340547
troca tudo por gatinhos
- Código:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
var images = document.getElementsByTagName("IMG");
for (var i=0; images[i]; i++){
var h = images[i].height;
var w = images[i].width;
var new_src = 'http://www.placekitten.com/' + w + '/' + h
images[i].setAttribute('src', new_src);
}
https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
- Kal-el
- Mensagens : 575
Data de inscrição : 18/04/2016
Idade : 32
Re: Bloquear todas imagens
2/9/2016, 23:46
Que isso jovem. Explica melhor. É pra mexer nos códigos do navegador?
_______________________________________
Meu Diário
http://www.comoparar.com/t3046-meu-diario-kal
- Admin
- Mensagens : 2
Data de inscrição : 02/09/2016
Re: Bloquear todas imagens
3/9/2016, 07:01
Kal-el escreveu:Que isso jovem. Explica melhor. É pra mexer nos códigos do navegador?
gatinhos
motivacionais;
https://i.imgur.com/PEiKOa9.png
https://i.imgur.com/q15LGMT.jpg
- Kal-el
- Mensagens : 575
Data de inscrição : 18/04/2016
Idade : 32
Re: Bloquear todas imagens
3/9/2016, 07:14
Que doido. Fica tipo pesquisa segura
_______________________________________
Meu Diário
http://www.comoparar.com/t3046-meu-diario-kal
- ConvidadoConvidado
Re: Bloquear todas imagens
5/9/2016, 16:22
Kal-el escreveu:Que doido. Fica tipo pesquisa segura
Não entendi nada, mas se funciona é ótimo; aparece um monte de gatinhos
Esse é o seu diário admin?
- ConvidadoConvidado
Re: Bloquear todas imagens
5/9/2016, 16:48
Pelo que entendi, "tampermonkey" é um complemento para o Chrome ou Firefox. Me parece que você escolhe o que ele exibirá, no caso o Admin usou a palavra "gatinhos" e independentemente do que pesquise, aparecerá apenas gatinhos. Acho que é isso.
Permissões neste sub-fórum
Não podes responder a tópicos