File tree 3 files changed +19
-1
lines changed 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ export function getChromeAPI(chrome = globalThis.chrome) {
54
54
requestUpdateCheck : chrome . runtime . requestUpdateCheck
55
55
? chrome . runtime . requestUpdateCheck
56
56
: null ,
57
+
58
+ setUninstallURL : chrome . runtime . setUninstallURL ,
57
59
} ,
58
60
59
61
permissions : {
Original file line number Diff line number Diff line change @@ -2,6 +2,14 @@ import { chromeAPI } from './chrome-api';
2
2
import { Extension } from './extension' ;
3
3
import type { ExternalMessage } from './messages' ;
4
4
5
+ /**
6
+ * Link to survey to show users after extension is uninstalled.
7
+ *
8
+ * See https://github.com/hypothesis/product-backlog/issues/1599.
9
+ */
10
+ export const uninstallURL =
11
+ 'https://docs.google.com/forms/d/e/1FAIpQLSd250Bi4xvxxvL-SgajHRmk8K1LMLZLGRoYkp6WSwT8PDTlLA/viewform?usp=sf_link' ;
12
+
5
13
/**
6
14
* Initialize the extension's Service Worker / background page.
7
15
*
@@ -67,6 +75,9 @@ export async function init() {
67
75
) ;
68
76
} ) ;
69
77
78
+ // Show survey to users after they uninstall extension.
79
+ chromeAPI . runtime . setUninstallURL ( uninstallURL ) ;
80
+
70
81
await initialized ;
71
82
}
72
83
Original file line number Diff line number Diff line change 1
- import { init , $imports } from '../../src/background' ;
1
+ import { init , uninstallURL , $imports } from '../../src/background' ;
2
2
3
3
let extension ;
4
4
@@ -28,6 +28,7 @@ describe('background/index', () => {
28
28
onInstalled : eventListenerStub ( ) ,
29
29
onMessageExternal : eventListenerStub ( ) ,
30
30
onUpdateAvailable : eventListenerStub ( ) ,
31
+ setUninstallURL : sinon . stub ( ) . resolves ( ) ,
31
32
} ,
32
33
management : {
33
34
getSelf : sinon . stub ( ) . resolves ( { installType : 'normal' , id : '1234' } ) ,
@@ -73,6 +74,10 @@ describe('background/index', () => {
73
74
} ) ;
74
75
} ) ;
75
76
77
+ it ( 'shows survey to users after extension is uninstalled' , ( ) => {
78
+ assert . calledWith ( fakeChromeAPI . runtime . setUninstallURL , uninstallURL ) ;
79
+ } ) ;
80
+
76
81
describe ( 'bouncer (hyp.is) message handling' , ( ) => {
77
82
it ( 'responds to basic "ping" message' , ( ) => {
78
83
const sender = { } ;
You can’t perform that action at this time.
0 commit comments