tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

doc-utils.js (1015B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const MDN_BASE_URL =
      8  "https://firefox-source-docs.mozilla.org/devtools-user/storage_inspector/";
      9 
     10 /**
     11 * Get the MDN URL for the specified storage type.
     12 *
     13 * @param {string} type Type of the storage.
     14 *
     15 * @return {string} The MDN URL for the storage type, or null if not available.
     16 */
     17 function getStorageTypeURL(type) {
     18  switch (type) {
     19    case "cookies":
     20      return `${MDN_BASE_URL}cookies`;
     21    case "localStorage":
     22    case "sessionStorage":
     23      return `${MDN_BASE_URL}local_storage_session_storage`;
     24    case "indexedDB":
     25      return `${MDN_BASE_URL}indexeddb`;
     26    case "Cache":
     27      return `${MDN_BASE_URL}cache_storage`;
     28    case "extensionStorage":
     29      return `${MDN_BASE_URL}extension_storage`;
     30    default:
     31      return null;
     32  }
     33 }
     34 
     35 module.exports = getStorageTypeURL;