mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: support for version 3.12 and later (#298)
This commit is contained in:
parent
69b0111382
commit
40dff715f7
1 changed files with 20 additions and 13 deletions
|
|
@ -66,20 +66,27 @@ export function processTree(tree: TreeNode[]): TreeNode {
|
|||
}
|
||||
|
||||
export function isEnterprise() {
|
||||
if (window.location.host === 'github.com') return false
|
||||
|
||||
return (
|
||||
(window.location.host !== 'github.com' &&
|
||||
/**
|
||||
* <a class="Header-link " href="https://host.com/" data-hotkey="g d" aria-label="Homepage Enterprise">
|
||||
* <span>Enterprise</span>
|
||||
* </a>
|
||||
*/
|
||||
$(
|
||||
[
|
||||
'a.Header-link[aria-label="Homepage Enterprise"]',
|
||||
'a.Header-link[aria-label="Homepage"]', // legacy support
|
||||
].join(),
|
||||
e => e.textContent?.trim() === 'Enterprise',
|
||||
)) ||
|
||||
/**
|
||||
* <a class="AppHeader-logo" href="https://host.com/" data-hotkey="g d" aria-label="Homepage Enterprise">
|
||||
* <svg></svg>
|
||||
* </a>
|
||||
*/
|
||||
$('a.AppHeader-logo[aria-label="Homepage Enterprise"]') !== null ||
|
||||
/**
|
||||
* <a class="Header-link " href="https://host.com/" data-hotkey="g d" aria-label="Homepage Enterprise">
|
||||
* <span>Enterprise</span>
|
||||
* </a>
|
||||
*/
|
||||
$(
|
||||
[
|
||||
'a.Header-link[aria-label="Homepage Enterprise"]',
|
||||
'a.Header-link[aria-label="Homepage"]', // legacy support
|
||||
].join(),
|
||||
e => e.textContent?.trim() === 'Enterprise',
|
||||
) ||
|
||||
false
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue