github-url-detection
github-url-detection copied to clipboard
Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.
If you open the repository URL on the default branch tree (**`tree/main`**) and run **`isRepoRoot()`** without providing a URL, the **`isRepoRoot()`** function always returns false. # case 1: isRepoRoot() return...
```js export const isRenderedTextFile = isSingleFile && endsWith(md) export const hasRenderedText = isRepoRoot || isRenderedTextFile || etc ``` These shouldn't include SVG and other rendered content Partially implemented in https://github.com/refined-github/refined-github/pull/4151/files#diff-a1b04b00ad1bdc63f8898dfbf43b2faf61ae3be4f50182d5a144d3e7f0dc7c29R14
For https://github.com/refined-github/github-url-detection/issues/146 I found a package that allows extraction of URLs from JSDoc. The issue is that we sometimes have comments around test URLs, which are impractical in JSDoc: -...
https://github.com/refined-github/refined-github/blob/158229413c3dde81907ce9376de957b706d9c693/source/features/embed-gist-inline.tsx#L34-L37 And then replace it in Refined GitHub
Extracted from https://github.com/refined-github/github-url-detection/issues/80 --- This "is gist" but it's not the standard page with a gist. Do we need a more specific detection? ``` https://gist.github.com/fregante/2205329b71218fa2c1d3/revisions ```
Another GitHub-related browser extension Gitako encountered the infamous "slash-in-branch-name" issue: https://github.com/EnixCoda/Gitako/issues/243 Refined GitHub had similar experience and that (along with other issues) resulted in the [`GitHubURL`](https://github.com/refined-github/refined-github/blob/3547c9bc0e60443dafe06752bc94e9e5b73f8d55/source/github-helpers/github-url.ts) helper (and its dependency...
It would be good to expose the example/test URLs in the JSDocs: I'm not sure how how to do this automatically though: - write the test URLs in JSDocs and...
Sometimes we want to test whether a page matches before it's done downloading, this can be done by passing a selector to `element-ready`. I have 2 ideas: ### Static definitions...
https://github.com/g-plane/typed-query-selector#strict-mode This type should make TS fail if a selector is invalid. This would avoid: - https://github.com/refined-github/github-url-detection/pull/120#issuecomment-1177894837 - https://github.com/refined-github/github-url-detection/commit/1a04193dc4f8809329e9c448c8d05b3e8094ad6d cc @yakov116
Example: https://github.com/pixiebrix/pixiebrix-extension/wiki/Web-Extensions-behaviors/_compare/664a8f7^...664a8f7 There might be more URLs.