diff --git a/extensions/chromium/options/options.html b/extensions/chromium/options/options.html index 94ea0b45a..0e406a8fc 100644 --- a/extensions/chromium/options/options.html +++ b/extensions/chromium/options/options.html @@ -80,6 +80,21 @@ body { + + diff --git a/extensions/chromium/options/options.js b/extensions/chromium/options/options.js index 214ede9cb..1d8ec12d8 100644 --- a/extensions/chromium/options/options.js +++ b/extensions/chromium/options/options.js @@ -74,6 +74,8 @@ Promise.all([ renderPreference = renderDefaultZoomValue(prefSchema.title); } else if (prefName === 'sidebarViewOnLoad') { renderPreference = renderSidebarViewOnLoad(prefSchema.title); + } else if (prefName === 'externalLinkTarget') { + renderPreference = renderExternalLinkTarget(prefSchema.title); } else { // Should NEVER be reached. Only happens if a new type of preference is // added to the storage manifest. @@ -190,3 +192,20 @@ function renderSidebarViewOnLoad(shortDescription) { } return renderPreference; } + +function renderExternalLinkTarget(shortDescription) { + var wrapper = importTemplate('externalLinkTarget-template'); + var select = wrapper.querySelector('select'); + select.onchange = function() { + chrome.storage.local.set({ + externalLinkTarget: parseInt(this.value) + }); + }; + wrapper.querySelector('span').textContent = shortDescription; + document.getElementById('settings-boxes').appendChild(wrapper); + + function renderPreference(value) { + select.value = value; + } + return renderPreference; +}