LoginSignup
2
2

More than 5 years have passed since last update.

Facebook Javascript SDKのFeedDialogの大きさが2倍になるバグに対処する

Posted at

AndroidのDensityが高いやつではFacebook Feed Dialogの幅が2倍になって、横スクロールしてしまう

Feed Dialog
https://developers.facebook.com/docs/reference/dialogs/feed/

ほかのDialog系も同じことになるかと思われる

CSSのルールを動的に追加すると直る

var bodyW = $('body').css('width');
var css = document.styleSheets.item(0);
var idx = document.styleSheets[0].cssRules.length;
css.insertRule("body.android #fb-root .fb_dialog_mobile iframe { width:" 
               + bodyW + " !important; }",  idx);

FB.ui(feedDialogOption, callback)を叩く直前くらいに↑をやる

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2