javascript - How to create a chrome extension with multiple views -


i've been looking sometime , cannot find way switch between different html views in chrome extension. creating , extension user log in , want switch profile.html view once user logs in. i've tried way below opens popup window, there away loads html page current extension view? or way edit extension view through javascrip?

    chrome.windows.create(       {         tabid:      newtab.id,         type:       "popup",         url:        chrome.extension.geturl('user_profile.html'),         focused: true       }, function(window){           //         });   }); 

there several ways this, easiest way think of single page app. don't change views based on user action, serve content based on context.

that said there 2 ways have seen done routinely:

  1. use iframes. not huge fann of one, if have existing server side rendered pages, it's easiest solution. essentially, make iframe take size need, update source of , let frame navigate need to.
  2. use javascript serve desired content. best solution situations. based on whatever context have, use javascript templating update user seeing. there's many different (and good) ways accomplish give specific code here, googling around should pretty easy.

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -