[{"data":1,"prerenderedAt":1559},["ShallowReactive",2],{"navigation_docs":3,"-fake-browser-implemented-apis":133,"-fake-browser-implemented-apis-surround":1556},[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":44,"body":135,"description":232,"extension":1551,"links":1552,"meta":1553,"navigation":348,"path":45,"seo":1554,"stem":46,"__hash__":1555},"docs/fake-browser/4.implemented-apis.md",{"type":136,"value":137,"toc":1540},"minimark",[138,142,155,162,180,185,217,222,1411,1416,1447,1451,1481,1491,1512,1518,1536],[139,140,141],"p",{},"This file lists all the implemented APIs, their caveots, limitations, and example tests. Example tests are written with vitest.",[143,144,145,149,152,154],"warning",{},[146,147,148],"strong",{},"Not all APIs are implemented!",[150,151],"br",{},[150,153],{},"\nFor all APIs not listed here, you will have to mock the functions behavior yourself, or you can submit a PR to add support 😄",[156,157,159],"h2",{"id":158},"alarms",[160,161,158],"code",{},[163,164,165,173],"ul",{},[166,167,168,169,172],"li",{},"All alarms APIs are implemented as in production, except for ",[160,170,171],{},"onAlarm",".",[166,174,175,176,179],{},"You have to manually call ",[160,177,178],{},"onAlarm.trigger()"," for your event listeners to be executed.",[156,181,183],{"id":182},"notifications",[160,184,182],{},[163,186,187,201],{},[166,188,189,192,193,196,197,200],{},[160,190,191],{},"create",", ",[160,194,195],{},"clear",", and ",[160,198,199],{},"getAll"," are fully implemented",[166,202,203,204,192,207,192,210,192,213,216],{},"You have to manually trigger all the events (",[160,205,206],{},"onClosed",[160,208,209],{},"onClicked",[160,211,212],{},"onButtonClicked",[160,214,215],{},"onShown",")",[218,219,221],"h3",{"id":220},"example-tests","Example Tests",[223,224,225,1007],"code-group",{},[226,227,233],"pre",{"className":228,"code":229,"filename":230,"language":231,"meta":232,"style":232},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { describe, it, beforeEach, vi, expect } from 'vitest';\nimport browser, { Notifications } from 'webextension-polyfill';\nimport { fakeBrowser } from '@webext-core/fake-browser';\n\nasync function ensureNotificationExists(\n  id: string,\n  notification: Notifications.CreateNotificationOptions,\n): Promise\u003Cvoid> {\n  const notifications = await browser.notifications.getAll();\n  if (!notifications[id]) await browser.notifications.create(id, notification);\n}\n\ndescribe('ensureNotificationExists', () => {\n  const id = 'some-id';\n  const notification: Notifications.CreateNotificationOptions = {\n    type: 'basic',\n    title: 'Some Title',\n    message: 'Some message...',\n  };\n\n  beforeEach(() => {\n    fakeBrowser.reset();\n  });\n\n  it('should create a notification if it does not exist', async () => {\n    const createSpy = vi.spyOn(browser.notifications, 'create');\n\n    await ensureNotificationExists(id, notification);\n\n    expect(createSpy).toBeCalledTimes(1);\n    expect(createSpy).toBeCalledWith(id, notification);\n  });\n\n  it('should not create the notification if it already exists', async () => {\n    await fakeBrowser.notifications.create(id, notification);\n    const createSpy = vi.spyOn(browser.notifications, 'create');\n\n    await ensureNotificationExists(id, notification);\n\n    expect(createSpy).not.toBeCalled();\n  });\n});\n","ensureNotificationExists.test.ts","ts","",[160,234,235,292,320,343,350,367,384,401,422,453,503,509,514,539,558,577,594,611,628,634,639,653,668,678,683,709,748,753,773,778,806,834,843,848,872,899,934,939,958,963,988,997],{"__ignoreMap":232},[236,237,240,244,248,252,255,258,260,263,265,268,270,273,276,279,282,286,289],"span",{"class":238,"line":239},"line",1,[236,241,243],{"class":242},"s7zQu","import",[236,245,247],{"class":246},"sMK4o"," {",[236,249,251],{"class":250},"sTEyZ"," describe",[236,253,254],{"class":246},",",[236,256,257],{"class":250}," it",[236,259,254],{"class":246},[236,261,262],{"class":250}," beforeEach",[236,264,254],{"class":246},[236,266,267],{"class":250}," vi",[236,269,254],{"class":246},[236,271,272],{"class":250}," expect",[236,274,275],{"class":246}," }",[236,277,278],{"class":242}," from",[236,280,281],{"class":246}," '",[236,283,285],{"class":284},"sfazB","vitest",[236,287,288],{"class":246},"'",[236,290,291],{"class":246},";\n",[236,293,295,297,300,302,304,307,309,311,313,316,318],{"class":238,"line":294},2,[236,296,243],{"class":242},[236,298,299],{"class":250}," browser",[236,301,254],{"class":246},[236,303,247],{"class":246},[236,305,306],{"class":250}," Notifications",[236,308,275],{"class":246},[236,310,278],{"class":242},[236,312,281],{"class":246},[236,314,315],{"class":284},"webextension-polyfill",[236,317,288],{"class":246},[236,319,291],{"class":246},[236,321,323,325,327,330,332,334,336,339,341],{"class":238,"line":322},3,[236,324,243],{"class":242},[236,326,247],{"class":246},[236,328,329],{"class":250}," fakeBrowser",[236,331,275],{"class":246},[236,333,278],{"class":242},[236,335,281],{"class":246},[236,337,338],{"class":284},"@webext-core/fake-browser",[236,340,288],{"class":246},[236,342,291],{"class":246},[236,344,346],{"class":238,"line":345},4,[236,347,349],{"emptyLinePlaceholder":348},true,"\n",[236,351,353,357,360,364],{"class":238,"line":352},5,[236,354,356],{"class":355},"spNyl","async",[236,358,359],{"class":355}," function",[236,361,363],{"class":362},"s2Zo4"," ensureNotificationExists",[236,365,366],{"class":246},"(\n",[236,368,370,374,377,381],{"class":238,"line":369},6,[236,371,373],{"class":372},"sHdIc","  id",[236,375,376],{"class":246},":",[236,378,380],{"class":379},"sBMFI"," string",[236,382,383],{"class":246},",\n",[236,385,387,390,392,394,396,399],{"class":238,"line":386},7,[236,388,389],{"class":372},"  notification",[236,391,376],{"class":246},[236,393,306],{"class":379},[236,395,172],{"class":246},[236,397,398],{"class":379},"CreateNotificationOptions",[236,400,383],{"class":246},[236,402,404,407,410,413,416,419],{"class":238,"line":403},8,[236,405,406],{"class":246},"):",[236,408,409],{"class":379}," Promise",[236,411,412],{"class":246},"\u003C",[236,414,415],{"class":379},"void",[236,417,418],{"class":246},">",[236,420,421],{"class":246}," {\n",[236,423,425,428,431,434,437,439,441,443,445,447,451],{"class":238,"line":424},9,[236,426,427],{"class":355},"  const",[236,429,430],{"class":250}," notifications",[236,432,433],{"class":246}," =",[236,435,436],{"class":242}," await",[236,438,299],{"class":250},[236,440,172],{"class":246},[236,442,182],{"class":250},[236,444,172],{"class":246},[236,446,199],{"class":362},[236,448,450],{"class":449},"swJcz","()",[236,452,291],{"class":246},[236,454,456,459,462,465,467,470,473,476,479,481,483,485,487,489,492,494,496,499,501],{"class":238,"line":455},10,[236,457,458],{"class":242},"  if",[236,460,461],{"class":449}," (",[236,463,464],{"class":246},"!",[236,466,182],{"class":250},[236,468,469],{"class":449},"[",[236,471,472],{"class":250},"id",[236,474,475],{"class":449},"]) ",[236,477,478],{"class":242},"await",[236,480,299],{"class":250},[236,482,172],{"class":246},[236,484,182],{"class":250},[236,486,172],{"class":246},[236,488,191],{"class":362},[236,490,491],{"class":449},"(",[236,493,472],{"class":250},[236,495,254],{"class":246},[236,497,498],{"class":250}," notification",[236,500,216],{"class":449},[236,502,291],{"class":246},[236,504,506],{"class":238,"line":505},11,[236,507,508],{"class":246},"}\n",[236,510,512],{"class":238,"line":511},12,[236,513,349],{"emptyLinePlaceholder":348},[236,515,517,520,522,524,527,529,531,534,537],{"class":238,"line":516},13,[236,518,519],{"class":362},"describe",[236,521,491],{"class":250},[236,523,288],{"class":246},[236,525,526],{"class":284},"ensureNotificationExists",[236,528,288],{"class":246},[236,530,254],{"class":246},[236,532,533],{"class":246}," ()",[236,535,536],{"class":355}," =>",[236,538,421],{"class":246},[236,540,542,544,547,549,551,554,556],{"class":238,"line":541},14,[236,543,427],{"class":355},[236,545,546],{"class":250}," id",[236,548,433],{"class":246},[236,550,281],{"class":246},[236,552,553],{"class":284},"some-id",[236,555,288],{"class":246},[236,557,291],{"class":246},[236,559,561,563,565,567,569,571,573,575],{"class":238,"line":560},15,[236,562,427],{"class":355},[236,564,498],{"class":250},[236,566,376],{"class":246},[236,568,306],{"class":379},[236,570,172],{"class":246},[236,572,398],{"class":379},[236,574,433],{"class":246},[236,576,421],{"class":246},[236,578,580,583,585,587,590,592],{"class":238,"line":579},16,[236,581,582],{"class":449},"    type",[236,584,376],{"class":246},[236,586,281],{"class":246},[236,588,589],{"class":284},"basic",[236,591,288],{"class":246},[236,593,383],{"class":246},[236,595,597,600,602,604,607,609],{"class":238,"line":596},17,[236,598,599],{"class":449},"    title",[236,601,376],{"class":246},[236,603,281],{"class":246},[236,605,606],{"class":284},"Some Title",[236,608,288],{"class":246},[236,610,383],{"class":246},[236,612,614,617,619,621,624,626],{"class":238,"line":613},18,[236,615,616],{"class":449},"    message",[236,618,376],{"class":246},[236,620,281],{"class":246},[236,622,623],{"class":284},"Some message...",[236,625,288],{"class":246},[236,627,383],{"class":246},[236,629,631],{"class":238,"line":630},19,[236,632,633],{"class":246},"  };\n",[236,635,637],{"class":238,"line":636},20,[236,638,349],{"emptyLinePlaceholder":348},[236,640,642,645,647,649,651],{"class":238,"line":641},21,[236,643,644],{"class":362},"  beforeEach",[236,646,491],{"class":449},[236,648,450],{"class":246},[236,650,536],{"class":355},[236,652,421],{"class":246},[236,654,656,659,661,664,666],{"class":238,"line":655},22,[236,657,658],{"class":250},"    fakeBrowser",[236,660,172],{"class":246},[236,662,663],{"class":362},"reset",[236,665,450],{"class":449},[236,667,291],{"class":246},[236,669,671,674,676],{"class":238,"line":670},23,[236,672,673],{"class":246},"  }",[236,675,216],{"class":449},[236,677,291],{"class":246},[236,679,681],{"class":238,"line":680},24,[236,682,349],{"emptyLinePlaceholder":348},[236,684,686,689,691,693,696,698,700,703,705,707],{"class":238,"line":685},25,[236,687,688],{"class":362},"  it",[236,690,491],{"class":449},[236,692,288],{"class":246},[236,694,695],{"class":284},"should create a notification if it does not exist",[236,697,288],{"class":246},[236,699,254],{"class":246},[236,701,702],{"class":355}," async",[236,704,533],{"class":246},[236,706,536],{"class":355},[236,708,421],{"class":246},[236,710,712,715,718,720,722,724,727,729,732,734,736,738,740,742,744,746],{"class":238,"line":711},26,[236,713,714],{"class":355},"    const",[236,716,717],{"class":250}," createSpy",[236,719,433],{"class":246},[236,721,267],{"class":250},[236,723,172],{"class":246},[236,725,726],{"class":362},"spyOn",[236,728,491],{"class":449},[236,730,731],{"class":250},"browser",[236,733,172],{"class":246},[236,735,182],{"class":250},[236,737,254],{"class":246},[236,739,281],{"class":246},[236,741,191],{"class":284},[236,743,288],{"class":246},[236,745,216],{"class":449},[236,747,291],{"class":246},[236,749,751],{"class":238,"line":750},27,[236,752,349],{"emptyLinePlaceholder":348},[236,754,756,759,761,763,765,767,769,771],{"class":238,"line":755},28,[236,757,758],{"class":242},"    await",[236,760,363],{"class":362},[236,762,491],{"class":449},[236,764,472],{"class":250},[236,766,254],{"class":246},[236,768,498],{"class":250},[236,770,216],{"class":449},[236,772,291],{"class":246},[236,774,776],{"class":238,"line":775},29,[236,777,349],{"emptyLinePlaceholder":348},[236,779,781,784,786,789,791,793,796,798,802,804],{"class":238,"line":780},30,[236,782,783],{"class":362},"    expect",[236,785,491],{"class":449},[236,787,788],{"class":250},"createSpy",[236,790,216],{"class":449},[236,792,172],{"class":246},[236,794,795],{"class":362},"toBeCalledTimes",[236,797,491],{"class":449},[236,799,801],{"class":800},"sbssI","1",[236,803,216],{"class":449},[236,805,291],{"class":246},[236,807,809,811,813,815,817,819,822,824,826,828,830,832],{"class":238,"line":808},31,[236,810,783],{"class":362},[236,812,491],{"class":449},[236,814,788],{"class":250},[236,816,216],{"class":449},[236,818,172],{"class":246},[236,820,821],{"class":362},"toBeCalledWith",[236,823,491],{"class":449},[236,825,472],{"class":250},[236,827,254],{"class":246},[236,829,498],{"class":250},[236,831,216],{"class":449},[236,833,291],{"class":246},[236,835,837,839,841],{"class":238,"line":836},32,[236,838,673],{"class":246},[236,840,216],{"class":449},[236,842,291],{"class":246},[236,844,846],{"class":238,"line":845},33,[236,847,349],{"emptyLinePlaceholder":348},[236,849,851,853,855,857,860,862,864,866,868,870],{"class":238,"line":850},34,[236,852,688],{"class":362},[236,854,491],{"class":449},[236,856,288],{"class":246},[236,858,859],{"class":284},"should not create the notification if it already exists",[236,861,288],{"class":246},[236,863,254],{"class":246},[236,865,702],{"class":355},[236,867,533],{"class":246},[236,869,536],{"class":355},[236,871,421],{"class":246},[236,873,875,877,879,881,883,885,887,889,891,893,895,897],{"class":238,"line":874},35,[236,876,758],{"class":242},[236,878,329],{"class":250},[236,880,172],{"class":246},[236,882,182],{"class":250},[236,884,172],{"class":246},[236,886,191],{"class":362},[236,888,491],{"class":449},[236,890,472],{"class":250},[236,892,254],{"class":246},[236,894,498],{"class":250},[236,896,216],{"class":449},[236,898,291],{"class":246},[236,900,902,904,906,908,910,912,914,916,918,920,922,924,926,928,930,932],{"class":238,"line":901},36,[236,903,714],{"class":355},[236,905,717],{"class":250},[236,907,433],{"class":246},[236,909,267],{"class":250},[236,911,172],{"class":246},[236,913,726],{"class":362},[236,915,491],{"class":449},[236,917,731],{"class":250},[236,919,172],{"class":246},[236,921,182],{"class":250},[236,923,254],{"class":246},[236,925,281],{"class":246},[236,927,191],{"class":284},[236,929,288],{"class":246},[236,931,216],{"class":449},[236,933,291],{"class":246},[236,935,937],{"class":238,"line":936},37,[236,938,349],{"emptyLinePlaceholder":348},[236,940,942,944,946,948,950,952,954,956],{"class":238,"line":941},38,[236,943,758],{"class":242},[236,945,363],{"class":362},[236,947,491],{"class":449},[236,949,472],{"class":250},[236,951,254],{"class":246},[236,953,498],{"class":250},[236,955,216],{"class":449},[236,957,291],{"class":246},[236,959,961],{"class":238,"line":960},39,[236,962,349],{"emptyLinePlaceholder":348},[236,964,966,968,970,972,974,976,979,981,984,986],{"class":238,"line":965},40,[236,967,783],{"class":362},[236,969,491],{"class":449},[236,971,788],{"class":250},[236,973,216],{"class":449},[236,975,172],{"class":246},[236,977,978],{"class":250},"not",[236,980,172],{"class":246},[236,982,983],{"class":362},"toBeCalled",[236,985,450],{"class":449},[236,987,291],{"class":246},[236,989,991,993,995],{"class":238,"line":990},41,[236,992,673],{"class":246},[236,994,216],{"class":449},[236,996,291],{"class":246},[236,998,1000,1003,1005],{"class":238,"line":999},42,[236,1001,1002],{"class":246},"}",[236,1004,216],{"class":250},[236,1006,291],{"class":246},[226,1008,1011],{"className":228,"code":1009,"filename":1010,"language":231,"meta":232,"style":232},"import { describe, it, beforeEach, vi, expect } from 'vitest';\nimport browser from 'webextension-polyfill';\nimport { fakeBrowser } from '@webext-core/fake-browser';\n\nasync function setupNotificationShownReports(\n  reportEvent: (notificationId: string) => void,\n): Promise\u003Cvoid> {\n  browser.notifications.onShown.addListener(id => reportEvent(id));\n}\n\ndescribe('setupNotificationShownReports', () => {\n  beforeEach(() => {\n    fakeBrowser.reset();\n  });\n\n  it('should properly report an analytics event when a notification is shown', async () => {\n    const reportAnalyticsEvent = vi.fn();\n    const id = 'notification-id';\n\n    setupNotificationShownReports(reportAnalyticsEvent);\n    await fakeBrowser.notifications.onShown.trigger(id);\n\n    expect(reportAnalyticsEvent).toBeCalledTimes(1);\n    expect(reportAnalyticsEvent).toBeCalledWith(id);\n  });\n});\n","setupNotificationShownReports.test.ts",[160,1012,1013,1049,1067,1087,1091,1102,1127,1141,1177,1181,1185,1206,1218,1230,1238,1242,1265,1285,1302,1306,1320,1347,1351,1373,1395,1403],{"__ignoreMap":232},[236,1014,1015,1017,1019,1021,1023,1025,1027,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047],{"class":238,"line":239},[236,1016,243],{"class":242},[236,1018,247],{"class":246},[236,1020,251],{"class":250},[236,1022,254],{"class":246},[236,1024,257],{"class":250},[236,1026,254],{"class":246},[236,1028,262],{"class":250},[236,1030,254],{"class":246},[236,1032,267],{"class":250},[236,1034,254],{"class":246},[236,1036,272],{"class":250},[236,1038,275],{"class":246},[236,1040,278],{"class":242},[236,1042,281],{"class":246},[236,1044,285],{"class":284},[236,1046,288],{"class":246},[236,1048,291],{"class":246},[236,1050,1051,1053,1056,1059,1061,1063,1065],{"class":238,"line":294},[236,1052,243],{"class":242},[236,1054,1055],{"class":250}," browser ",[236,1057,1058],{"class":242},"from",[236,1060,281],{"class":246},[236,1062,315],{"class":284},[236,1064,288],{"class":246},[236,1066,291],{"class":246},[236,1068,1069,1071,1073,1075,1077,1079,1081,1083,1085],{"class":238,"line":322},[236,1070,243],{"class":242},[236,1072,247],{"class":246},[236,1074,329],{"class":250},[236,1076,275],{"class":246},[236,1078,278],{"class":242},[236,1080,281],{"class":246},[236,1082,338],{"class":284},[236,1084,288],{"class":246},[236,1086,291],{"class":246},[236,1088,1089],{"class":238,"line":345},[236,1090,349],{"emptyLinePlaceholder":348},[236,1092,1093,1095,1097,1100],{"class":238,"line":352},[236,1094,356],{"class":355},[236,1096,359],{"class":355},[236,1098,1099],{"class":362}," setupNotificationShownReports",[236,1101,366],{"class":246},[236,1103,1104,1107,1109,1111,1114,1116,1118,1120,1122,1125],{"class":238,"line":369},[236,1105,1106],{"class":362},"  reportEvent",[236,1108,376],{"class":246},[236,1110,461],{"class":246},[236,1112,1113],{"class":372},"notificationId",[236,1115,376],{"class":246},[236,1117,380],{"class":379},[236,1119,216],{"class":246},[236,1121,536],{"class":355},[236,1123,1124],{"class":379}," void",[236,1126,383],{"class":246},[236,1128,1129,1131,1133,1135,1137,1139],{"class":238,"line":386},[236,1130,406],{"class":246},[236,1132,409],{"class":379},[236,1134,412],{"class":246},[236,1136,415],{"class":379},[236,1138,418],{"class":246},[236,1140,421],{"class":246},[236,1142,1143,1146,1148,1150,1152,1154,1156,1159,1161,1163,1165,1168,1170,1172,1175],{"class":238,"line":403},[236,1144,1145],{"class":250},"  browser",[236,1147,172],{"class":246},[236,1149,182],{"class":250},[236,1151,172],{"class":246},[236,1153,215],{"class":250},[236,1155,172],{"class":246},[236,1157,1158],{"class":362},"addListener",[236,1160,491],{"class":449},[236,1162,472],{"class":372},[236,1164,536],{"class":355},[236,1166,1167],{"class":362}," reportEvent",[236,1169,491],{"class":449},[236,1171,472],{"class":250},[236,1173,1174],{"class":449},"))",[236,1176,291],{"class":246},[236,1178,1179],{"class":238,"line":424},[236,1180,508],{"class":246},[236,1182,1183],{"class":238,"line":455},[236,1184,349],{"emptyLinePlaceholder":348},[236,1186,1187,1189,1191,1193,1196,1198,1200,1202,1204],{"class":238,"line":505},[236,1188,519],{"class":362},[236,1190,491],{"class":250},[236,1192,288],{"class":246},[236,1194,1195],{"class":284},"setupNotificationShownReports",[236,1197,288],{"class":246},[236,1199,254],{"class":246},[236,1201,533],{"class":246},[236,1203,536],{"class":355},[236,1205,421],{"class":246},[236,1207,1208,1210,1212,1214,1216],{"class":238,"line":511},[236,1209,644],{"class":362},[236,1211,491],{"class":449},[236,1213,450],{"class":246},[236,1215,536],{"class":355},[236,1217,421],{"class":246},[236,1219,1220,1222,1224,1226,1228],{"class":238,"line":516},[236,1221,658],{"class":250},[236,1223,172],{"class":246},[236,1225,663],{"class":362},[236,1227,450],{"class":449},[236,1229,291],{"class":246},[236,1231,1232,1234,1236],{"class":238,"line":541},[236,1233,673],{"class":246},[236,1235,216],{"class":449},[236,1237,291],{"class":246},[236,1239,1240],{"class":238,"line":560},[236,1241,349],{"emptyLinePlaceholder":348},[236,1243,1244,1246,1248,1250,1253,1255,1257,1259,1261,1263],{"class":238,"line":579},[236,1245,688],{"class":362},[236,1247,491],{"class":449},[236,1249,288],{"class":246},[236,1251,1252],{"class":284},"should properly report an analytics event when a notification is shown",[236,1254,288],{"class":246},[236,1256,254],{"class":246},[236,1258,702],{"class":355},[236,1260,533],{"class":246},[236,1262,536],{"class":355},[236,1264,421],{"class":246},[236,1266,1267,1269,1272,1274,1276,1278,1281,1283],{"class":238,"line":596},[236,1268,714],{"class":355},[236,1270,1271],{"class":250}," reportAnalyticsEvent",[236,1273,433],{"class":246},[236,1275,267],{"class":250},[236,1277,172],{"class":246},[236,1279,1280],{"class":362},"fn",[236,1282,450],{"class":449},[236,1284,291],{"class":246},[236,1286,1287,1289,1291,1293,1295,1298,1300],{"class":238,"line":613},[236,1288,714],{"class":355},[236,1290,546],{"class":250},[236,1292,433],{"class":246},[236,1294,281],{"class":246},[236,1296,1297],{"class":284},"notification-id",[236,1299,288],{"class":246},[236,1301,291],{"class":246},[236,1303,1304],{"class":238,"line":630},[236,1305,349],{"emptyLinePlaceholder":348},[236,1307,1308,1311,1313,1316,1318],{"class":238,"line":636},[236,1309,1310],{"class":362},"    setupNotificationShownReports",[236,1312,491],{"class":449},[236,1314,1315],{"class":250},"reportAnalyticsEvent",[236,1317,216],{"class":449},[236,1319,291],{"class":246},[236,1321,1322,1324,1326,1328,1330,1332,1334,1336,1339,1341,1343,1345],{"class":238,"line":641},[236,1323,758],{"class":242},[236,1325,329],{"class":250},[236,1327,172],{"class":246},[236,1329,182],{"class":250},[236,1331,172],{"class":246},[236,1333,215],{"class":250},[236,1335,172],{"class":246},[236,1337,1338],{"class":362},"trigger",[236,1340,491],{"class":449},[236,1342,472],{"class":250},[236,1344,216],{"class":449},[236,1346,291],{"class":246},[236,1348,1349],{"class":238,"line":655},[236,1350,349],{"emptyLinePlaceholder":348},[236,1352,1353,1355,1357,1359,1361,1363,1365,1367,1369,1371],{"class":238,"line":670},[236,1354,783],{"class":362},[236,1356,491],{"class":449},[236,1358,1315],{"class":250},[236,1360,216],{"class":449},[236,1362,172],{"class":246},[236,1364,795],{"class":362},[236,1366,491],{"class":449},[236,1368,801],{"class":800},[236,1370,216],{"class":449},[236,1372,291],{"class":246},[236,1374,1375,1377,1379,1381,1383,1385,1387,1389,1391,1393],{"class":238,"line":680},[236,1376,783],{"class":362},[236,1378,491],{"class":449},[236,1380,1315],{"class":250},[236,1382,216],{"class":449},[236,1384,172],{"class":246},[236,1386,821],{"class":362},[236,1388,491],{"class":449},[236,1390,472],{"class":250},[236,1392,216],{"class":449},[236,1394,291],{"class":246},[236,1396,1397,1399,1401],{"class":238,"line":685},[236,1398,673],{"class":246},[236,1400,216],{"class":449},[236,1402,291],{"class":246},[236,1404,1405,1407,1409],{"class":238,"line":711},[236,1406,1002],{"class":246},[236,1408,216],{"class":250},[236,1410,291],{"class":246},[156,1412,1414],{"id":1413},"runtime",[160,1415,1413],{},[163,1417,1418,1425,1434],{},[166,1419,1420,1421,1424],{},"All events have been implemented, but all of them other than ",[160,1422,1423],{},"onMessage"," must be triggered manually.",[166,1426,1427,1430,1431,172],{},[160,1428,1429],{},"runtime.id"," is a hardcoded string. You can set this to whatever you want, but it is reset to the hardcoded value when calling ",[160,1432,1433],{},"reset()",[166,1435,1436,1437,1440,1441,1443,1444,1446],{},"Unlike in a real production, ",[160,1438,1439],{},"sendMessage"," will trigger ",[160,1442,1423],{}," listeners setup in the same JS context. This allows you to add a listener when setting up your test, then call ",[160,1445,1439],{}," to trigger it.",[156,1448,1449],{"id":121},[160,1450,121],{},[163,1452,1453,1469,1478],{},[166,1454,1455,1456,192,1459,192,1462,196,1465,1468],{},"The ",[160,1457,1458],{},"local",[160,1460,1461],{},"sync",[160,1463,1464],{},"session",[160,1466,1467],{},"managed"," storages are all stored separately in memory.",[166,1470,1471,192,1474,1477],{},[160,1472,1473],{},"storage.onChanged",[160,1475,1476],{},"storage.{area}.onChanged"," events are all triggered when updating values.",[166,1479,1480],{},"Each storage area can be reset individually.",[156,1482,1484,1487,1488],{"id":1483},"tabs-and-windows",[160,1485,1486],{},"tabs"," and ",[160,1489,1490],{},"windows",[163,1492,1493,1496],{},[166,1494,1495],{},"Fully implemented.",[166,1497,1498,1499,1501,1502,1504,1505,1487,1508,1511],{},"All methods trigger corresponding ",[160,1500,1486],{}," events AND ",[160,1503,1490],{}," events depending on what happened (ie: closing the last tab of a window would trigger both ",[160,1506,1507],{},"tabs.onRemoved",[160,1509,1510],{},"windows.onRemoved",").",[156,1513,1515],{"id":1514},"webnavigation",[160,1516,1517],{},"webNavigation",[163,1519,1520,1530],{},[166,1521,1522,1523,1487,1526,1529],{},"The two functions, ",[160,1524,1525],{},"getFrame",[160,1527,1528],{},"getAllFrames"," are not implemented. You will have to mock their return values yourself.",[166,1531,1532,1533],{},"All the event listeners are implemented, but none are triggered automatically. They can be triggered manually by calling ",[160,1534,1535],{},"browser.webNavigation.{event}.trigger(...)",[1537,1538,1539],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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);}",{"title":232,"searchDepth":294,"depth":294,"links":1541},[1542,1543,1546,1547,1548,1550],{"id":158,"depth":294,"text":158},{"id":182,"depth":294,"text":182,"children":1544},[1545],{"id":220,"depth":322,"text":221},{"id":1413,"depth":294,"text":1413},{"id":121,"depth":294,"text":121},{"id":1483,"depth":294,"text":1549},"tabs and windows",{"id":1514,"depth":294,"text":1517},"md",null,{},{"title":44,"description":232},"zkOrh4ham1lbaDvW14lGTlCAsGqOn8jIR78cB2WCW-w",[1557,1558],{"title":40,"path":41,"stem":42,"description":232,"children":-1},{"title":48,"path":49,"stem":50,"description":232,"children":-1},1779305976532]