We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be7b896 commit 9eff6b3Copy full SHA for 9eff6b3
1 file changed
contentscript.js
@@ -1,7 +1,17 @@
1
(() => {
2
- let ghCodeDropdown = getDropUL();
3
- ghCodeDropdown.appendChild(openInCodeElement(`${document.URL}.git`));
+ mutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+ var observer = new MutationObserver(function(mutations, observer) {
4
+ let ghCodeDropdown = getDropUL();
5
+ if (ghCodeDropdown != undefined) {
6
+ ghCodeDropdown.appendChild(openInCodeElement(`${document.URL}.git`));
7
+ }
8
+ })
9
10
+ observer.observe(document, {
11
+ subtree: true,
12
+ attributes: true
13
+ });
14
+
15
function openInCodeElement(repo) {
16
// If the LI is already here, return
17
if (document.getElementById("openincode") != null) return;
0 commit comments