set website on current tab google chrome developer code example

Example 1: set website on current tab google chrome developer

"permissions": [
  "tabs"
],

Example 2: set website on current tab google chrome developer

chrome.tabs.getCurrent(function (tab) {
  //Your code below...
  var tabUrl = encodeURIComponent(tab.url);
  var tabTitle = encodeURIComponent(tab.title);
  var myNewUrl = "https://www.mipanga.com/Content/Submit?url=" + tabUrl + "&title=" + tabTitle;

  //Update the url here.
  chrome.tabs.update(tab.id, {url: myNewUrl});
});

Tags:

Misc Example