google-chrome-extension


Chrome Extension Popup is too high when first click


as I found out a few days ago when you click an extension button and popup shows up, its height is much higher than it needs to be if you need the height to be less than 350px. When something happens in the popup (animation e.g.) the height is adjusted properly according to the content. Setting height to html, body and general wrapper element didn't help. It might be some bug in the latest update of Chrome, I cannot test it in earlier builds, because of autoupdate.
I'll be thankful for any thoughts and advices.
Libor
UPDATE: I started to examine what can possibly cause this behaviour and found out this happens because of Twitter and Google Plus share buttons. They both modify DOM structure adding script tag which adds iframe. When commented, popup bubble appeared in correct size. The weird thing is facebook like button script does more or less the same, but it doesn't mess up the layout at all.
Like it was said here, the good solution to solve this problem is changing <html> to <!doctype html>
Same thing here with my extension and Chrome 19 on Windows 7. I must note that there were no problems with the previous version of Chrome. As you stated the issue shows up only on the first appearance of the popup - it shrinks correctly afterwards).
I'm using jQuery in my extension and I think I've partially solved it by adding
$("body").fadeOut(10).fadeIn(50);
though it doesn't always work (it probably will if you increment the fadeIn delay but!). Hope someone can provide a better solution to this.
EDIT. This should be guaranteed to always work (using your hint) although the user might see the resizing happening for a fraction of second:
$(window).load(function() {
$("body").fadeOut(10, function() { $(this).show(); });
});

Related Links

Firefox Addon - Send message from webpage to background script
Chrome extension localization in manifest not working
popup.html view not updating the newly assigned values of $scope variables in controller in popup.js
I need to connect my existing chrome extension to firebase .could anyone pls suggest a new way?
error while sending message from extension script to content script
how to customize rightclick on chrome devtools elements panel
Chrome extension custom payment solution in Pakistan?
How to get support tab for Google Chrome extension
How to Log to Console from Chrome Extension?
Chrome Extension - Detecting New Posts on a 4chan thread
Chrome Extension Template (Regex Filter) needed
Tricking a javascript code to think it has a focused window?
my extension keep getting rejected and i don't know why
Can I use an alias to release a chrome extension?
Chrome Extension - make a ribbon
Minimize developer tools window while debugging a chrome extension

Categories

HOME
lodash
gis
jsrender
youtube-api-v3
frameworks
cross-browser
ravendb
qt-creator
google-apps-marketplace
hapi
caml
lombok
http-status-code-504
undefined
ab-testing
google-cloud-speech
kryo
object-detection
csrf-protection
microsoft-r
shopware
url-scheme
intel-pin
rst2pdf
libuv
libssl
tasklet
gsoap
fabric8
winrt-xaml-toolkit
azure-sql-database
jmonkeyengine
jquery-bootgrid
x11-forwarding
sharefile
hilbert-curve
avro4s
gzipstream
estimote
turbogears
http-redirect
flickr-api
termination
pango
theming
rails-routing
ionicons
fancybox-2
statsd
pillow
flutterwave
nbconvert
word-vba-mac
static-ip-address
deadbolt-2
color-picker
home-directory
player
nsviewcontroller
asp.net5
jfugue
xna-4.0
cyclomatic-complexity
python-3.2
django-unittest
libressl
iis-arr
sysinternals
event-bubbling
p2
pretty-print
bridge.net
python-green
clicktag
angularjs-ng-click
html-helper
contenttype
hippomocks
mechanize-ruby
file-locking
tinn-r
mhtml
libstdc++
tridion-worldserver
mod-auth
hamachi
yui-datatable
mirah
database-management
eqatec
defensive-programming
zune
ugc

Resources

Encrypt Message