title: Can i push the "back" button in chrome with javascript
body: <p>I would like help to understand how I can go to the previous page in chrome if i try to join m.facebook.com</p>
  
  <p>Let me show you my code until now:</p>
  
  <pre><code>var host = "http://www.google.com";          // here you put the URL that you want to be redirected 
  
  
  
  chrome.webRequest.onBeforeRequest.addListener(
      function(details) {
           return {redirectUrl: host + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]};              //where it says "host" you put the name of the var that you have set above to the URL that you want to be redirected
  
  
      },
      {
          urls: [
              "*://m.facebook.com/*"                  // here you put the URL that you want to block.
          ],
          types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
      },
      ["blocking"]
  );
  </code></pre>
  
  <p>manifest</p>
  
  <pre><code>{
      "name": "Facebook Notification Block",
      "description": "Block Notification",
      "version": "1.0",
      "manifest_version": 2,
      "background": {
          "scripts": [
              "background.js"
          ]
      },
      "permissions": [
              "webRequest",
              "*://facebook.com/*",
              "*://m.facebook.com/*",
              "*://www.facebook.com/*",
          "webRequestBlocking"
      ]
  }
  </code></pre>
  
  <p>With this code I can "block" m.facebook.com and redirect to "www.google.com" from my Chrome browser when i have installed the extension. But i want just to go to the previous page.</p>
  
  <p>UPDATE1:</p>
  
  <p>Like christopher suggested i tried these codes</p>
  
  <p>added to the manifest permissions "history"</p>
  
  <p>and i made the background.js like this</p>
  
  <pre><code>var goBack = function() {
      window.history.back();
  }
  
  chrome.webRequest.onBeforeRequest.addListener(
      function(details) {
           return {goBack};               
  
  
      },
      {
          urls: [
              "*://m.facebook.com/*"                  // here you put the URL that you want to block.
          ],
          types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"]
      },
      ["blocking"]
  );
  </code></pre>
  
  <p>But i cant figure out my mistake.</p>