[{"data":1,"prerenderedAt":947},["ShallowReactive",2],{"navigation_docs":3,"-storage-api":133,"-storage-api-surround":945},[4,22,51,62,73,84,99,118],{"title":5,"path":6,"stem":7,"children":8,"page":21},"Get Started","/get-started","0.get-started",[9,13,17],{"title":10,"path":11,"stem":12},"Introduction","/get-started/introduction","0.get-started/0.introduction",{"title":14,"path":15,"stem":16},"Browser Support","/get-started/browser-support","0.get-started/1.browser-support",{"title":18,"path":19,"stem":20},"Contributing","/get-started/contributing","0.get-started/2.contributing",false,{"title":23,"path":24,"stem":25,"children":26,"page":21},"Fake Browser","/fake-browser","fake-browser",[27,31,35,39,43,47],{"title":28,"path":29,"stem":30},"Installation","/fake-browser/installation","fake-browser/0.installation",{"title":32,"path":33,"stem":34},"Testing Frameworks","/fake-browser/testing-frameworks","fake-browser/1.testing-frameworks",{"title":36,"path":37,"stem":38},"Triggering Events","/fake-browser/triggering-events","fake-browser/2.triggering-events",{"title":40,"path":41,"stem":42},"Resetting State","/fake-browser/reseting-state","fake-browser/3.reseting-state",{"title":44,"path":45,"stem":46},"Implemented Apis","/fake-browser/implemented-apis","fake-browser/4.implemented-apis",{"title":48,"path":49,"stem":50},"Api","/fake-browser/api","fake-browser/api",{"title":52,"path":53,"stem":54,"children":55,"page":21},"Isolated Element","/isolated-element","isolated-element",[56,59],{"title":28,"path":57,"stem":58},"/isolated-element/installation","isolated-element/0.installation",{"title":48,"path":60,"stem":61},"/isolated-element/api","isolated-element/api",{"title":63,"path":64,"stem":65,"children":66,"page":21},"Job Scheduler","/job-scheduler","job-scheduler",[67,70],{"title":28,"path":68,"stem":69},"/job-scheduler/installation","job-scheduler/0.installation",{"title":48,"path":71,"stem":72},"/job-scheduler/api","job-scheduler/api",{"title":74,"path":75,"stem":76,"children":77,"page":21},"Match Patterns","/match-patterns","match-patterns",[78,81],{"title":28,"path":79,"stem":80},"/match-patterns/installation","match-patterns/0.installation",{"title":48,"path":82,"stem":83},"/match-patterns/api","match-patterns/api",{"title":85,"path":86,"stem":87,"children":88,"page":21},"Messaging","/messaging","messaging",[89,92,96],{"title":28,"path":90,"stem":91},"/messaging/installation","messaging/0.installation",{"title":93,"path":94,"stem":95},"Protocol Maps","/messaging/protocol-maps","messaging/1.protocol-maps",{"title":48,"path":97,"stem":98},"/messaging/api","messaging/api",{"title":100,"path":101,"stem":102,"children":103,"page":21},"Proxy Service","/proxy-service","proxy-service",[104,107,111,115],{"title":28,"path":105,"stem":106},"/proxy-service/installation","proxy-service/0.installation",{"title":108,"path":109,"stem":110},"Defining Services","/proxy-service/defining-services","proxy-service/1.defining-services",{"title":112,"path":113,"stem":114},"Service Keys","/proxy-service/service-keys","proxy-service/2.service-keys",{"title":48,"path":116,"stem":117},"/proxy-service/api","proxy-service/api",{"title":119,"path":120,"stem":121,"children":122,"page":21},"Storage","/storage","storage",[123,126,130],{"title":28,"path":124,"stem":125},"/storage/installation","storage/0.installation",{"title":127,"path":128,"stem":129},"Typescript","/storage/typescript","storage/1.typescript",{"title":48,"path":131,"stem":132},"/storage/api","storage/api",{"id":134,"title":48,"body":135,"description":170,"extension":940,"links":941,"meta":942,"navigation":343,"path":131,"seo":943,"stem":132,"__hash__":944},"docs/storage/api.md",{"type":136,"value":137,"toc":928},"minimark",[138,141,146,158,164,262,269,274,304,308,449,455,724,731,749,755,778,788,794,816,823,829,851,857,868,874,896,903,909,911,924],[139,140],"hr",{},[142,143,145],"h2",{"id":144},"description","description: \"\"",[147,148,149,150],"alert",{},"See ",[151,152,154],"a",{"href":153},"/storage/installation/",[155,156,157],"code",{},"@webext-core/storage",[142,159,161],{"id":160},"defineextensionstorage",[155,162,163],{},"defineExtensionStorage",[165,166,171],"pre",{"className":167,"code":168,"language":169,"meta":170,"style":170},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","function defineExtensionStorage\u003CTSchema extends AnySchema = AnySchema>(\n  storage: Storage.StorageArea,\n): ExtensionStorage\u003CTSchema> {\n  // ...\n}\n","ts","",[155,172,173,208,230,249,256],{"__ignoreMap":170},[174,175,178,182,186,190,194,197,200,203,205],"span",{"class":176,"line":177},"line",1,[174,179,181],{"class":180},"spNyl","function",[174,183,185],{"class":184},"s2Zo4"," defineExtensionStorage",[174,187,189],{"class":188},"sMK4o","\u003C",[174,191,193],{"class":192},"sBMFI","TSchema",[174,195,196],{"class":180}," extends",[174,198,199],{"class":192}," AnySchema",[174,201,202],{"class":188}," =",[174,204,199],{"class":192},[174,206,207],{"class":188},">(\n",[174,209,211,215,218,221,224,227],{"class":176,"line":210},2,[174,212,214],{"class":213},"sHdIc","  storage",[174,216,217],{"class":188},":",[174,219,220],{"class":192}," Storage",[174,222,223],{"class":188},".",[174,225,226],{"class":192},"StorageArea",[174,228,229],{"class":188},",\n",[174,231,233,236,239,241,243,246],{"class":176,"line":232},3,[174,234,235],{"class":188},"):",[174,237,238],{"class":192}," ExtensionStorage",[174,240,189],{"class":188},[174,242,193],{"class":192},[174,244,245],{"class":188},">",[174,247,248],{"class":188}," {\n",[174,250,252],{"class":176,"line":251},4,[174,253,255],{"class":254},"sHwdD","  // ...\n",[174,257,259],{"class":176,"line":258},5,[174,260,261],{"class":188},"}\n",[263,264,265,266,268],"p",{},"Create a storage instance with an optional schema, ",[155,267,193],{},", for type safety.",[270,271,273],"h3",{"id":272},"parameters","Parameters",[275,276,277],"ul",{},[278,279,280,289,292,293,296,297,300,301,223],"li",{},[281,282,283],"em",{},[284,285,286],"strong",{},[155,287,288],{},"storage: Storage.StorageArea",[290,291],"br",{},"The storage to to use. Either ",[155,294,295],{},"Browser.storage.local",", ",[155,298,299],{},"Browser.storage.sync",", or ",[155,302,303],{},"Browser.storage.managed",[270,305,307],{"id":306},"examples","Examples",[165,309,311],{"className":167,"code":310,"language":169,"meta":170,"style":170},"import browser from 'webextension-polyfill';\n\ninterface Schema {\n  installDate: number;\n}\nconst extensionStorage = defineExtensionStorage\u003CSchema>(browser.storage.local);\n\nconst date = await extensionStorage.getItem(\"installDate\");\n",[155,312,313,339,345,355,368,372,407,412],{"__ignoreMap":170},[174,314,315,319,323,326,329,333,336],{"class":176,"line":177},[174,316,318],{"class":317},"s7zQu","import",[174,320,322],{"class":321},"sTEyZ"," browser ",[174,324,325],{"class":317},"from",[174,327,328],{"class":188}," '",[174,330,332],{"class":331},"sfazB","webextension-polyfill",[174,334,335],{"class":188},"'",[174,337,338],{"class":188},";\n",[174,340,341],{"class":176,"line":210},[174,342,344],{"emptyLinePlaceholder":343},true,"\n",[174,346,347,350,353],{"class":176,"line":232},[174,348,349],{"class":180},"interface",[174,351,352],{"class":192}," Schema",[174,354,248],{"class":188},[174,356,357,361,363,366],{"class":176,"line":251},[174,358,360],{"class":359},"swJcz","  installDate",[174,362,217],{"class":188},[174,364,365],{"class":192}," number",[174,367,338],{"class":188},[174,369,370],{"class":176,"line":258},[174,371,261],{"class":188},[174,373,375,378,381,384,386,388,391,393,396,398,400,402,405],{"class":176,"line":374},6,[174,376,377],{"class":180},"const",[174,379,380],{"class":321}," extensionStorage ",[174,382,383],{"class":188},"=",[174,385,185],{"class":184},[174,387,189],{"class":188},[174,389,390],{"class":192},"Schema",[174,392,245],{"class":188},[174,394,395],{"class":321},"(browser",[174,397,223],{"class":188},[174,399,121],{"class":321},[174,401,223],{"class":188},[174,403,404],{"class":321},"local)",[174,406,338],{"class":188},[174,408,410],{"class":176,"line":409},7,[174,411,344],{"emptyLinePlaceholder":343},[174,413,415,417,420,422,425,428,430,433,436,439,442,444,447],{"class":176,"line":414},8,[174,416,377],{"class":180},[174,418,419],{"class":321}," date ",[174,421,383],{"class":188},[174,423,424],{"class":317}," await",[174,426,427],{"class":321}," extensionStorage",[174,429,223],{"class":188},[174,431,432],{"class":184},"getItem",[174,434,435],{"class":321},"(",[174,437,438],{"class":188},"\"",[174,440,441],{"class":331},"installDate",[174,443,438],{"class":188},[174,445,446],{"class":321},")",[174,448,338],{"class":188},[142,450,452],{"id":451},"extensionstorage",[155,453,454],{},"ExtensionStorage",[165,456,458],{"className":167,"code":457,"language":169,"meta":170,"style":170},"interface ExtensionStorage\u003CTSchema extends AnySchema> {\n  clear(): Promise\u003Cvoid>;\n  getItem\u003CTKey extends keyof TSchema>(\n    key: TKey,\n  ): Promise\u003CRequired\u003CTSchema>[TKey] | null>;\n  setItem\u003CTKey extends keyof TSchema>(\n    key: TKey,\n    value: TSchema[TKey],\n  ): Promise\u003Cvoid>;\n  removeItem\u003CTKey extends keyof TSchema>(key: TKey): Promise\u003Cvoid>;\n  onChange\u003CTKey extends keyof TSchema>(\n    key: TKey,\n    cb: OnChangeCallback\u003CTSchema, TKey>,\n  ): RemoveListenerCallback;\n}\n",[155,459,460,478,497,517,529,563,580,590,608,621,657,675,686,709,719],{"__ignoreMap":170},[174,461,462,464,466,468,470,472,474,476],{"class":176,"line":177},[174,463,349],{"class":180},[174,465,238],{"class":192},[174,467,189],{"class":188},[174,469,193],{"class":192},[174,471,196],{"class":180},[174,473,199],{"class":192},[174,475,245],{"class":188},[174,477,248],{"class":188},[174,479,480,483,486,489,491,494],{"class":176,"line":210},[174,481,482],{"class":359},"  clear",[174,484,485],{"class":188},"():",[174,487,488],{"class":192}," Promise",[174,490,189],{"class":188},[174,492,493],{"class":192},"void",[174,495,496],{"class":188},">;\n",[174,498,499,502,504,507,509,512,515],{"class":176,"line":232},[174,500,501],{"class":359},"  getItem",[174,503,189],{"class":188},[174,505,506],{"class":192},"TKey",[174,508,196],{"class":180},[174,510,511],{"class":188}," keyof",[174,513,514],{"class":192}," TSchema",[174,516,207],{"class":188},[174,518,519,522,524,527],{"class":176,"line":251},[174,520,521],{"class":213},"    key",[174,523,217],{"class":188},[174,525,526],{"class":192}," TKey",[174,528,229],{"class":188},[174,530,531,534,536,538,541,543,545,547,550,552,555,558,561],{"class":176,"line":258},[174,532,533],{"class":188},"  ):",[174,535,488],{"class":192},[174,537,189],{"class":188},[174,539,540],{"class":192},"Required",[174,542,189],{"class":188},[174,544,193],{"class":192},[174,546,245],{"class":188},[174,548,549],{"class":321},"[",[174,551,506],{"class":192},[174,553,554],{"class":321},"] ",[174,556,557],{"class":188},"|",[174,559,560],{"class":192}," null",[174,562,496],{"class":188},[174,564,565,568,570,572,574,576,578],{"class":176,"line":374},[174,566,567],{"class":359},"  setItem",[174,569,189],{"class":188},[174,571,506],{"class":192},[174,573,196],{"class":180},[174,575,511],{"class":188},[174,577,514],{"class":192},[174,579,207],{"class":188},[174,581,582,584,586,588],{"class":176,"line":409},[174,583,521],{"class":213},[174,585,217],{"class":188},[174,587,526],{"class":192},[174,589,229],{"class":188},[174,591,592,595,597,599,601,603,606],{"class":176,"line":414},[174,593,594],{"class":213},"    value",[174,596,217],{"class":188},[174,598,514],{"class":192},[174,600,549],{"class":321},[174,602,506],{"class":192},[174,604,605],{"class":321},"]",[174,607,229],{"class":188},[174,609,611,613,615,617,619],{"class":176,"line":610},9,[174,612,533],{"class":188},[174,614,488],{"class":192},[174,616,189],{"class":188},[174,618,493],{"class":192},[174,620,496],{"class":188},[174,622,624,627,629,631,633,635,637,640,643,645,647,649,651,653,655],{"class":176,"line":623},10,[174,625,626],{"class":359},"  removeItem",[174,628,189],{"class":188},[174,630,506],{"class":192},[174,632,196],{"class":180},[174,634,511],{"class":188},[174,636,514],{"class":192},[174,638,639],{"class":188},">(",[174,641,642],{"class":213},"key",[174,644,217],{"class":188},[174,646,526],{"class":192},[174,648,235],{"class":188},[174,650,488],{"class":192},[174,652,189],{"class":188},[174,654,493],{"class":192},[174,656,496],{"class":188},[174,658,660,663,665,667,669,671,673],{"class":176,"line":659},11,[174,661,662],{"class":359},"  onChange",[174,664,189],{"class":188},[174,666,506],{"class":192},[174,668,196],{"class":180},[174,670,511],{"class":188},[174,672,514],{"class":192},[174,674,207],{"class":188},[174,676,678,680,682,684],{"class":176,"line":677},12,[174,679,521],{"class":213},[174,681,217],{"class":188},[174,683,526],{"class":192},[174,685,229],{"class":188},[174,687,689,692,694,697,699,701,704,706],{"class":176,"line":688},13,[174,690,691],{"class":213},"    cb",[174,693,217],{"class":188},[174,695,696],{"class":192}," OnChangeCallback",[174,698,189],{"class":188},[174,700,193],{"class":192},[174,702,703],{"class":188},",",[174,705,526],{"class":192},[174,707,708],{"class":188},">,\n",[174,710,712,714,717],{"class":176,"line":711},14,[174,713,533],{"class":188},[174,715,716],{"class":192}," RemoveListenerCallback",[174,718,338],{"class":188},[174,720,722],{"class":176,"line":721},15,[174,723,261],{"class":188},[263,725,726,727,730],{},"This is the interface for the storage objects exported from the package. It is similar to ",[155,728,729],{},"localStorage",", except for a few differences:",[275,732,733,741],{},[278,734,735,740],{},[281,736,737],{},[284,738,739],{},"It's async"," since the web extension storage APIs are async.",[278,742,743,744,223],{},"It can store any data type, ",[281,745,746],{},[284,747,748],{},"not just strings",[142,750,752],{"id":751},"localextstorage",[155,753,754],{},"localExtStorage",[165,756,758],{"className":167,"code":757,"language":169,"meta":170,"style":170},"const localExtStorage: ExtensionStorage\u003CAnySchema>;\n",[155,759,760],{"__ignoreMap":170},[174,761,762,764,767,769,771,773,776],{"class":176,"line":177},[174,763,377],{"class":180},[174,765,766],{"class":321}," localExtStorage",[174,768,217],{"class":188},[174,770,238],{"class":192},[174,772,189],{"class":188},[174,774,775],{"class":192},"AnySchema",[174,777,496],{"class":188},[263,779,780,781,783,784,787],{},"An implementation of ",[155,782,454],{}," based on the ",[155,785,786],{},"browser.storage.local"," storage area.",[142,789,791],{"id":790},"managedextstorage",[155,792,793],{},"managedExtStorage",[165,795,797],{"className":167,"code":796,"language":169,"meta":170,"style":170},"const managedExtStorage: ExtensionStorage\u003CAnySchema>;\n",[155,798,799],{"__ignoreMap":170},[174,800,801,803,806,808,810,812,814],{"class":176,"line":177},[174,802,377],{"class":180},[174,804,805],{"class":321}," managedExtStorage",[174,807,217],{"class":188},[174,809,238],{"class":192},[174,811,189],{"class":188},[174,813,775],{"class":192},[174,815,496],{"class":188},[263,817,780,818,783,820,787],{},[155,819,454],{},[155,821,822],{},"browser.storage.managed",[142,824,826],{"id":825},"sessionextstorage",[155,827,828],{},"sessionExtStorage",[165,830,832],{"className":167,"code":831,"language":169,"meta":170,"style":170},"const sessionExtStorage: ExtensionStorage\u003CAnySchema>;\n",[155,833,834],{"__ignoreMap":170},[174,835,836,838,841,843,845,847,849],{"class":176,"line":177},[174,837,377],{"class":180},[174,839,840],{"class":321}," sessionExtStorage",[174,842,217],{"class":188},[174,844,238],{"class":192},[174,846,189],{"class":188},[174,848,775],{"class":192},[174,850,496],{"class":188},[263,852,780,853,783,855,787],{},[155,854,454],{},[155,856,786],{},[275,858,859,862,865],{},[278,860,861],{},"Added to Chrome 102 as of May 24th, 2022.",[278,863,864],{},"Added to Safari 16.4 as of March 27th, 2023.",[278,866,867],{},"Added to Firefox 115 as of July 4th, 2023.",[142,869,871],{"id":870},"syncextstorage",[155,872,873],{},"syncExtStorage",[165,875,877],{"className":167,"code":876,"language":169,"meta":170,"style":170},"const syncExtStorage: ExtensionStorage\u003CAnySchema>;\n",[155,878,879],{"__ignoreMap":170},[174,880,881,883,886,888,890,892,894],{"class":176,"line":177},[174,882,377],{"class":180},[174,884,885],{"class":321}," syncExtStorage",[174,887,217],{"class":188},[174,889,238],{"class":192},[174,891,189],{"class":188},[174,893,775],{"class":192},[174,895,496],{"class":188},[263,897,780,898,783,900,787],{},[155,899,454],{},[155,901,902],{},"browser.storage.sync",[263,904,905,907],{},[290,906],{},[290,908],{},[139,910],{},[263,912,913],{},[281,914,915,916],{},"API reference generated by ",[151,917,921],{"href":918,"rel":919},"https://github.com/aklinker1/webext-core/blob/main/docs/generate-api-references.ts",[920],"nofollow",[155,922,923],{},"docs/generate-api-references.ts",[925,926,927],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}",{"title":170,"searchDepth":210,"depth":210,"links":929},[930,931,935,936,937,938,939],{"id":144,"depth":210,"text":145},{"id":160,"depth":210,"text":163,"children":932},[933,934],{"id":272,"depth":232,"text":273},{"id":306,"depth":232,"text":307},{"id":451,"depth":210,"text":454},{"id":751,"depth":210,"text":754},{"id":790,"depth":210,"text":793},{"id":825,"depth":210,"text":828},{"id":870,"depth":210,"text":873},"md",null,{},{"title":48,"description":170},"kHuUyXuHq-BiK3xD2ThknR_nDWKozpyYylVGhmq1ifM",[946,941],{"title":127,"path":128,"stem":129,"description":170,"children":-1},1779305978054]