title: background.html vs. background.js - chrome extension
body: <p>I am really confused here. I am trying to understand the file architecture of chrome extension. I am reading this doc: <a href="https://developer.chrome.com/extensions/overview#arch" rel="noreferrer">https://developer.chrome.com/extensions/overview#arch</a></p>
  
  <p>My situation: </p>
  
  <p>I want to setup the oauth flow so that user can log in inside the extension (the other endpoint is my django backend). Till now, I have these files: </p>
  
  <pre><code>background.js 
  content.js
  popup.html
  manifest.json
  </code></pre>
  
  <p>where my content.js sends message to background.js and gets response back. so far so fine! </p>
  
  <p>But now while reading the doc for oauth, i am confused not knowing what the background.html is. is it actually the file which should contain all js code of my background.js? but, if i change this in manifest to <code>.html</code>, like: </p>
  
  <pre><code>"background": {
  "persistent": false,
  "scripts": ["jquery111.js", "background.html"]
  </code></pre>
  
  <p>extension isnot working anymore. In OAuth doc, it says: </p>
  
  <pre><code>Place the four library files in the root of your extension directory 
  (or wherever your JavaScript is stored). Then include the .js files in your 
  background page...
  Your background page will manage the OAuth flow.
  </code></pre>
  
  <p>but in the <a href="https://developer.chrome.com/extensions/tut_oauth" rel="noreferrer">architecture doc</a>, it says: </p>
  
  <pre><code>This figure shows the browser action's background page, which is defined by
  background.html and has JavaScript code that controls the behavior of 
  the browser action in both windows.
  </code></pre>
  
  <p>what is the difference between background.html and background.js? </p>