Skip to content

Instantly share code, notes, and snippets.

@5zen
Created July 19, 2013 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5zen/6035187 to your computer and use it in GitHub Desktop.
Save 5zen/6035187 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name mc_wideframe
// @version 1.00
// @description MC★あくしず フレーム変更
// @include http://mixi.jp/run_appli.pl?id=39132
// @include http://*.mixi-platform.com/*
// @include http://*.bmcaxis.jp/*
// @icon https://raw.github.com/5zen/mc_beyond/master/icon.png
// @grant GM_listValues
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @grant GM_log
// @grant GM_getValue
// @grant GM_deleteValue
// @grant GM_addStyle
// ==/UserScript==
var CHECK_TIME = 500;
if(location.hostname.match("mixi-platform.com")){
if(!location.pathname.match("/gadgets/ifr")) return;
if(decodeURIComponent(location.search).match(/&app_id=[^&]+&/)!="&app_id=39132&") return;
}
GM_addStyle(
".adBanner {display:none !important;}" +
"#ADDSPACE, .appliSidebox01 {display:none !important;}" +
".appliMainbox01,.gadgetStage, .gadgetStage iframe {width:1370px !important;}" +
"#page { margin: 0 auto; position: relative; text-align: left; width: 1390px;}"
);
if(location.href.match(/m\d+\.bmcaxis\.jp/)){ // フレームチェック
if(window.parent != window){ // フレームで無かったら何もしない
var height = 0;
setInterval(function() {
var target = window.parent.postMessage ? window.parent : undefined;
if(height == document.body.offsetHeight) return;
height = document.body.offsetHeight;
if(typeof target != 'undefined') {
var send = {"command": "resize","height" : height,};
target.postMessage(JSON.stringify(send),'http://mixi.jp');
}
},CHECK_TIME);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment