chrome.storage.local.get('openIn', item => {
  if (item.openIn) {
    openIn = item.openIn;
  }

  ['page', 'link'].forEach(context => {
    chrome.contextMenus.create({
      contexts: [context],
      id: 'resurrect-' + context,
      title: chrome.i18n.getMessage('resurrect' + i18n) + context,
    }, logLastError);

    chrome.contextMenus.create({
      enabled: false,
      id: 'resurrect-' + where + '-' + context,
      parentId: 'resurrect-' + context,
      title: chrome.i18n.getMessage('resurrectConfig' + i18n),
    });

    for (let [name, id, icon] of [
      ['Google', 'google', 'google'],
      ['Google (text only)', 'googletext', 'google'],
      ['The Internet Archive', 'archive', 'waybackmachine'],
      ['The Internet Archive (list all)', 'archivelist', 'waybackmachine'],
      ['archive.is', 'archiveis', 'archiveis'],
      ['WebCite', 'webcitation', 'webcitation'],
      ['Memento Timetravel', 'mementoweb', 'mementoweb'],
      ['isup.me', 'IsUp', 'isup'],
    ]) {
      chrome.contextMenus.create({
        contexts: [context],
        icons: {16: 'icons/cacheicons/' + icon + '.png'},
        id: 'resurrect-' + id + '-' + context,
        parentId: 'resurrect-' + context,
      title: chrome.i18n.getMessage('resurrect_' + context),
      }, logLastError);
    }

    chrome.contextMenus.create({
      id: 'resurrect-separator-config-' + context,
      type: 'separator',
      contexts: [context],
      parentId: 'resurrect-' + context
    }, logLastError);

    chrome.contextMenus.create({
      enabled: false,
      id: 'resurrect-in-' + context,
      parentId: 'resurrect-' + context,
      title: 'In:',
    });

    for (let [name, where, checked] of [
      ['the current tab', 'current-tab', openIn == openInEnum.CURRENT_TAB],
      ['a new tab (foreground)', 'new-tab', openIn == openInEnum.NEW_TAB],
      ['a new tab (background)', 'bg-tab', openIn == openInEnum.NEW_BGTAB],
      ['a new window', 'new-window', openIn == openInEnum.NEW_WINDOW],
    ]) {
      chrome.contextMenus.create({
        id: 'resurrect-' + where + '-' + context,
        type: 'radio',
        title: name,
        contexts: [context],
        checked: checked,
        parentId: 'resurrect-' + context
      }, logLastError);
    }
  });
});

chrome.contextMenus.onClicked.addListener(function(info, tab) {
  let id = info.menuItemId;
  let url = null;
  if (id.endsWith('-page')) {
    url = info.pageUrl;
  } else if (id.endsWith('-link')) {
    url = info.linkUrl;
  }
  if (id.startsWith('resurrect-google-')) {
    goToUrl(genGoogleUrl(url), openIn);
  } else if (id.startsWith('resurrect-googletext-')) {
    goToUrl(genGoogleTextUrl(url), openIn);
  } else if (id.startsWith('resurrect-archive-')) {
    goToUrl(genIaUrl(url), openIn);
  } else if (id.startsWith('resurrect-archivelist-')) {
    goToUrl(genIaListUrl(url), openIn);
  } else if (id.startsWith('resurrect-archiveis-')) {
    goToUrl(genArchiveIsUrl(url), openIn);
  } else if (id.startsWith('resurrect-isup-')) {
    goToUrl(genIsUpUrl(url), openIn);
  } else if (id.startsWith('resurrect-webcitation-')) {
    goToUrl(genWebCiteUrl(url), openIn);
  } else if (id.startsWith('resurrect-mementoweb-')) {
    goToUrl(genMementoUrl(url), openIn);
  } else if (id.startsWith('resurrect-current-tab-')) {
    setOpenIn(openInEnum.CURRENT_TAB);
  } else if (id.startsWith('resurrect-new-tab-')) {
    setOpenIn(openInEnum.NEW_TAB);
  } else if (id.startsWith('resurrect-bg-tab-')) {
    setOpenIn(openInEnum.NEW_BGTAB);
  } else if (id.startsWith('resurrect-new-window-')) {
    setOpenIn(openInEnum.NEW_WINDOW);
  }
});

@@ -270,25 +270,18 @@
 esurrect
+_
 '
- + i18n)
  + conte
@@ -278,24 +278,25 @@
 _' + context
+)
 ,%0A    %7D, log
@@ -312,223 +312,8 @@
 );%0A%0A
-    chrome.contextMenus.create(%7B%0A      enabled: false,%0A      id: 'resurrect-' + where + '-' + context,%0A      parentId: 'resurrect-' + context,%0A      title: chrome.i18n.getMessage('resurrectConfig' + i18n),%0A    %7D);%0A%0A
     
@@ -399,20 +399,12 @@
 ogle
- (text only)
+Text
 ', '
@@ -431,37 +431,24 @@
 '%5D,%0A      %5B'
-The Internet 
 Archive', 'a
@@ -487,39 +487,19 @@
   %5B'
-The Internet Archive (list all)
+ArchiveList
 ', '
@@ -543,17 +543,16 @@
   %5B'
-a
+A
 rchive
-.i
+I
 s', 
@@ -592,17 +592,21 @@
 %5B'WebCit
-e
+ation
 ', 'webc
@@ -650,19 +650,11 @@
 ento
- Timetravel
+Web
 ', '
@@ -693,22 +693,19 @@
   %5B'
-isup.me
+IsUp
 ', '
-IsU
+isu
 p', 
@@ -931,32 +931,34 @@
  context,%0A      
+  
 title: chrome.i1
@@ -977,36 +977,32 @@
 e('resurrect
-_
 ' + 
-context
+name
 ),%0A      %7D, 
@@ -1225,169 +1225,8 @@
 );%0A%0A
-    chrome.contextMenus.create(%7B%0A      enabled: false,%0A      id: 'resurrect-in-' + context,%0A      parentId: 'resurrect-' + context,%0A      title: 'In:',%0A    %7D);%0A%0A
     
@@ -1274,21 +1274,16 @@
   %5B'
-the c
+C
 urrent
- t
+T
 ab',
@@ -1345,30 +1345,14 @@
   %5B'
-a new tab (foreground)
+NewTab
 ', '
@@ -1404,30 +1404,13 @@
   %5B'
-a new tab (background)
+BgTab
 ', '
@@ -1463,15 +1463,12 @@
   %5B'
-a new w
+NewW
 indo
@@ -1650,21 +1650,65 @@
   title:
+ chrome.i18n.getMessage('resurrectConfig' +
  name
+)
 ,%0A      

Update background.js