-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcontent.js
More file actions
25 lines (23 loc) · 1.17 KB
/
content.js
File metadata and controls
25 lines (23 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(async () => {
const patchUrl = chrome.runtime.getURL('modules/composerPatchButton.js');
const replyUrl = chrome.runtime.getURL('modules/commentReplyButton.js');
const gitlabPatchUrl = chrome.runtime.getURL('modules/gitlabPatchFetcher.js');
const highlightOPCommentsPath = chrome.runtime.getURL('modules/highlightOPComments.js');
const previewPath = chrome.runtime.getURL('modules/patchPreview.js');
const patchModule = await import(patchUrl);
const replyModule = await import(replyUrl);
const gitlabModule = await import(gitlabPatchUrl);
import(highlightOPCommentsPath).then(mod => mod.highlightOPComments());
import(previewPath).then(mod => mod.addInlinePatchPreviews());
if (document.readyState === 'complete' || document.readyState === 'interactive') {
patchModule.addComposerPatchColumn();
replyModule.addReplyButtonsToComments();
gitlabModule.addGitLabMRPatchComposer();
} else {
window.addEventListener('DOMContentLoaded', () => {
patchModule.addComposerPatchColumn();
replyModule.addReplyButtonsToComments();
gitlabModule.addGitLabMRPatchComposer();
});
}
})();