Skip to content

Commit

Permalink
bitbucket-copy-commit-reference: update CSS for Cloud
Browse files Browse the repository at this point in the history
After an update of Bitbucket Cloud, the mangled CSS class names, which
are used by bitbucket-copy-commit-reference.user.js have changed.
Update the CSS classes used for finding the commit message container
button by method getCommitMessage() in class BitbucketCloud.  Attempt to
do it in a less fragile way, with one fewer mangled CSS class name.

While debugging this, I got very confused, because the HTML contains two
very similar CSS classes in nearby nodes:

	e1tw8lnx1
	e1tw8lnx11

the first of the two is the class we need.
  • Loading branch information
rybak committed Mar 30, 2024
1 parent d836b45 commit d1ff7b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bitbucket-copy-commit-reference.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Bitbucket: copy commit reference
// @namespace https://github.com/rybak/atlassian-tweaks
// @version 7
// @version 8
// @description Adds a "Copy commit reference" link to every commit page on Bitbucket Cloud and Bitbucket Server.
// @license AGPL-3.0-only
// @author Andrei Rybak
Expand All @@ -16,7 +16,7 @@
// ==/UserScript==

/*
* Copyright (C) 2023 Andrei Rybak
* Copyright (C) 2023-2024 Andrei Rybak
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -111,7 +111,7 @@
}

getCommitMessage() {
const commitMsgContainer = document.querySelector('.css-1qa9ryl.e1tw8lnx1+div');
const commitMsgContainer = document.querySelector('[data-testid="Content"] .e1tw8lnx1+div');
return commitMsgContainer.innerText;
}

Expand Down

0 comments on commit d1ff7b1

Please sign in to comment.