From 5a9e841f37304ec17950680e5fd9d284c06e6f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sun, 24 Jan 2016 20:06:42 +0100 Subject: [PATCH] is now able to insert the menu on pages that use framesets. --- src/plugin-specific/add-iframe-to-page.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugin-specific/add-iframe-to-page.js b/src/plugin-specific/add-iframe-to-page.js index 36aeb1f..e952238 100644 --- a/src/plugin-specific/add-iframe-to-page.js +++ b/src/plugin-specific/add-iframe-to-page.js @@ -13,9 +13,20 @@ $.get(chrome.extension.getURL('index-angular-app.html'), function (htmlData) { //add a helper class to aid in styling later. $('html').addClass('tagit-top-wrapper'); + + /** + * If the page is using a frameset + * we'll need to remove it and + * insert a new body tag instead. + */ + if ($('frameset').length > 0) { + $('frameset').remove(); + var newbody = document.createElement("body"); + $('html').append(newbody); + } else { + $('body').children().remove(); + } - //empty the page - $('body').children().remove(); //reinsert page this time inside an iframe $('body').append(iframeMainContent);