
gif
일부 애니메이션(Google+, 9gag 등) 이 포함된 페이지를 방문하면 모든 애니메이션이 로드되기 시작하는 것 같습니다. 내 대역폭은 제한되어 있으며 실제로 보고 싶지 않은 한 다운로드되는 것을 원하지 않습니다. 방금 멈추는 일부 플러그인을 보았습니다.생기하지만 이미지 자체는다운로드됨그래도. 9gag.com에는 처음에 정적 이미지(애니메이션 gif인 경우)만 표시하고 클릭한 후에만 다운로드를 시작하는 이 기능이 있었습니다(지금은 제거되었습니다).
그렇다면 중지할 수 있는 플러그인이 있나요?다운로드 중gif? 아니면 확장을 작성해야 합니까? 어떠한 제안?
답변1
아직 적합한 확장/플러그인이 없습니다. 다음 사용자 스크립트를 사용해 보았습니다.탬퍼몽키크롬에서. 잘 작동하고 있습니다. 9gag.com 사이트에서 모든 gif(ajax gif 포함)를 차단합니다. 어떤 이유로 Google+의 ajax gif는 차단되지 않습니다(조사 중). 많은 감사시네텍그의 도움, 노력 및 코드에 대해. 다음은 사용자 스크립트입니다(대부분의 스크립트는Synetec의 사용자 스크립트):
// ==UserScript==
// @name gifBlock
// @namespace http://i.have.no.homepage/
// @version 0.1
// @description Stops downloading gif images (including ajax gifs) in 9gag.com (or any page if you just fix the @match rule)
// @match http://*.9gag.com
// @copyright 2012+, Nobody
// ==/UserScript==
function tamperMonkeyWrap()
{
function log(m)
{
console.log(m);
}
function jQWrap($)
{
log("Extension execution begins...");
function blockGifs()
{
$('img').each(function() {
var $img = $(this),
src = $img.attr('src'),
w = $img.width(),
h = $img.height(),
cursor = $img.css('cursor'),
parts = src.split('.'),
ext = parts[parts.length-1];
if ($.trim(ext.toLowerCase()) != "gif")
return;
$img.attr('data-imgurl', src);
$img.data('cursor', cursor);
$img.css('cursor', 'pointer');
$img.addClass('gif-blocked');
h = h > 100? h : 100;
$img.attr('src', '//ipsumimage.appspot.com/'+w+'x'+h+'?l=Gif (Click)');
});
}
function interceptAjax () {
$('body').ajaxComplete(
function (event, requestData)
{
log("Blocking GIF [Ajax] ...");
blockGifs();
}
);
}
$(document).ready(function() {
log("Blocking GIF [Ready]....");
blockGifs();
interceptAjax();
$(document).on('click', 'img.gif-blocked', function(ev) {
var $img = $(this),
url = $img.attr('data-imgurl'),
cursor = $img.data('cursor');
$img.attr('src', url);
$img.css('cursor', cursor);
$img.removeClass('gif-blocked');
ev.preventDefault();
return false;
});
});
log("Document is not ready yet. trying block just in case it takes time to be _ready_ (google+).");
blockGifs();
}
if (window.jQuery == undefined)
{
log("Loading jQuery...");
var scriptTag = document.createElement('script');
scriptTag.src = "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";
scriptTag.onload = function(){
log("jQuery loaded.");
window.jQuery = jQuery;
jQWrap(jQuery);
};
document.getElementsByTagName('head')[0].appendChild(scriptTag);
}
else
{
log("jQuery already included in the page");
jQWrap(window.jQuery);
}
}
var scriptTag = document.createElement('script');
scriptTag.text = '(' + tamperMonkeyWrap.toString() + ')();';
document.getElementsByTagName('head')[0].appendChild(scriptTag);
지금:
- TamperMonkey 설치
- 대시 보드로 이동
- '새 스크립트'를 클릭하세요.
- 위 코드를 붙여넣으세요
- 저장하고 작동하는지 확인하세요. (현재는 9gag.com에서만 작동합니다. 하지만
@match
원하는 사이트와 일치하도록 지시어를 변경할 수 있습니다.@match http://*/*
모든 사이트(http)에서 작동하려면 사용하세요.https
보안된 http 사이트(예: google+)의 경우 로 변경하세요.
답변2
몇 가지 멋진 Firefox 애드온:
adblock - 지능적인 광고 차단
flashblock - 클릭하지 않을 때까지 모든 플래시가 차단됩니다.
imgblock - 모든 이미지를 어디서나 차단합니다(클릭하면 일시적으로 비활성화될 수 있음).
ghostery - 소셜 네트워킹 사이트를 차단합니다(페이지 방문당 100KB 이상을 벌 수 있습니다!).