Skip to content

Instantly share code, notes, and snippets.

@t-f-m
Created December 19, 2013 21:02
Show Gist options
  • Save t-f-m/8046205 to your computer and use it in GitHub Desktop.
Save t-f-m/8046205 to your computer and use it in GitHub Desktop.
キャプチャ時にembedないしobjectを含むiframe、frameにカバーをかける(※作りかけ)
(function(){
var advice = function(proceed, args, target, methodName){
var ctx = args[0];
makeOpaqueFlash(ctx.document);
var doc = ctx.document;
innerDocs = $x('//*[self::iframe or self::frame]', doc, true);
innerDocs.forEach(function(frame){
if($x('//*[self::embed or self::object]', frame.contentWindow.document, true).length){
var style = window.getComputedStyle(frame);
var cover = doc.createElement('div');
cover.style.position = (style.position === 'fixed' ? 'fixed' : 'absolute');
//style.
cover.style.left = style.left;
cover.style.top = style.top;
cover.style.width = style.width;
cover.style.height = style.height;
cover.style.zIndex = (style.zIndex + 1);
cover.style.backgroundColor = 'transparent';
cover.classList.add('tombfix_alternative_opaque_flash');
doc.body.appendChild(cover);
}
});
var result = proceed(args);
return result;
}
addAround(Tombfix.Service.extractors['Photo - Capture'], 'extract', advice);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment