javascript - Change HTML Page in Crossrider Popup -


i have popup called picker.html contains 2 options - either going options page (that crossrider doesnt natively support) or opening webpage. there more options.

now, when "go options" button pressed want change popup go file options.html.

i tried using appapi.browseraction.setpopup work after click on browser action making useless. window.location doesnt work crossrider uses background.html , there's no api path of resource file.

you can use document.open , appapi.resources.get change whole html. need run crossridermain make sure used resources being loaded.

see working example below. experience it's not possible change height of new popup / page, please edit answer if finds tested possibility (css doesn't appear working here).

<!doctype html> <html>     <head>         <script type="text/javascript">             function crossridermain($) {                 appapi.resources.includecss('html/bootstrap.min.css');                 appapi.resources.includecss('html/skin.css');                  appapi.resources.includejs('js/bootstrap.min.js');             }              appapi.ready(function($) {                 $("#gooptions").click(function() {                     var newdoc = document.open("text/html", "replace");                     newdoc.write(appapi.resources.get('options.html'));                     newdoc.close();                      $("body").css("width","400px");                     crossridermain($);                      eval(appapi.resources.get('js/bootstrap.min.js'));                      //use eval js need load new page, won't loaded crossridermain($)!                 });                 $("#goproton").click(function() {                     appapi.openurl({url: "https://protonmail.ch/login", where:"tab", focus:true});                     window.close();                 });             });          </script>     </head>     <body>         <div class="well bs-component" style="margin:0; border-radius:0; border:none; padding:5px;">             <div class="form-horizontal">               <div class="col-lg-12" style="margin-bottom:5px; padding:0;">                 <button type="submit" class="btn btn-default" id="gooptions" style="width:100%;">go options</button>               </div>               <div class="col-lg-12" style="padding:0;">                 <button type="submit" class="btn btn-primary" id="goproton" style="width:100%;">open protonmail</button>               </div>             </div>         </div>     </body> </html> 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -