summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
authorGravatar Vincent Klaiber <vinkla@users.noreply.github.com> 2019-02-14 02:42:28 +0100
committerGravatar Federico Brigante <github@bfred.it> 2019-02-14 09:42:28 +0800
commit7a37f74a81266740d0faaba1c8490ad434a03ed3 (patch)
tree0334b3d4e75e88c9a3d15662e70b1d1d2648130b /source/libs/utils.ts
parentabebd9fc7b9f07d8ea0981b0f6e196ef0c5483ca (diff)
downloadrefined-github-7a37f74a81266740d0faaba1c8490ad434a03ed3.tar.gz
refined-github-7a37f74a81266740d0faaba1c8490ad434a03ed3.tar.zst
refined-github-7a37f74a81266740d0faaba1c8490ad434a03ed3.zip
Drop `op-labels` feature (#1776)
It has been implemented by GitHub
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r--source/libs/utils.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts
index 421d9f66..d304815e 100644
--- a/source/libs/utils.ts
+++ b/source/libs/utils.ts
@@ -67,3 +67,13 @@ export const flatZip = (table, limit = Infinity) => {
return zipped;
};
+
+export function getOP(): string {
+ if (isPR()) {
+ const titleRegex = /^(.+) by (\S+) ยท Pull Request #(\d+)/;
+ const match = titleRegex.exec(document.title);
+ return match && match[2];
+ }
+
+ return select('.timeline-comment-header-text .author').textContent;
+}