Brandon Bertelsen
Brandon Bertelsen

Reputation: 44658

Workaround Google Chrome Extension 800px limit on iframe

Is there a workaround for the 800px width limit for iframes on google chrome extensions when the button is adjacent to the URL bar? Even if it's something I can change on my end only. It's for personal use...

Upvotes: 1

Views: 790

Answers (1)

David
David

Reputation: 13999

As Chris mentioned, you cannot change the frame size beyond 800px. However there is a way to make your extension run in a new tab instead of a extension frame...

In your background page, call a function to open a new tab when the extension icon is clicked:

chrome.browserAction.onClicked.addListener(function(tab){
    chrome.tabs.create(
      {url:"chrome-extension://################################/popup.html"}
    );    
});

NOTE: You need your extension ID to replace the 32 #'s and whichever filename you would like to open replace 'popup.html'... ALSO, be sure to remove "popup": "popup.html" from your manifest file, so that the extension doesn't try to first load in a frame...

Upvotes: 4

Related Questions