MCPcopy
hub / github.com/Justineo/github-hovercard / checkInstalled

Function checkInstalled

demo/src/demo.js:60–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 checkInstalled();
59
60 function checkInstalled() {
61 switch (browser) {
62 case 'chrome':
63 case 'opera': {
64 chrome.runtime.sendMessage(EXT_ID, { message: 'version' }, (resp) => {
65 if (resp) {
66 setInstalled();
67 }
68 });
69 break;
70 }
71 case 'mozilla': {
72 let timer = setInterval(() => {
73 if (document.body.getAttribute('data-github-hovercard')) {
74 setInstalled();
75 clearTimeout(timer);
76 }
77 }, 100);
78 break;
79 }
80 }
81 }
82
83 function setInstalled(isInstalledNow) {
84 $installBtn.text('Installed').prop('disabled', true).addClass('disabled');

Callers 1

demo.jsFile · 0.85

Calls 3

setInstalledFunction · 0.85
clearTimeoutFunction · 0.85
sendMessageMethod · 0.45

Tested by

no test coverage detected