@@ -114,7 +114,7 @@ export interface ButtonContributionParams {
114114 urlTransformer ?: ( originalURL : string ) => string ;
115115}
116116
117- function createElement (
117+ function createContainerElement (
118118 type : "div" | "li" ,
119119 props : {
120120 [ key : string ] : string ;
@@ -134,7 +134,7 @@ export const buttonContributions: ButtonContributionParams[] = [
134134 // "https://dev.azure.com/services-azure/_git/project2"
135135 ] ,
136136 selector : "div.repos-files-header-commandbar:nth-child(1)" ,
137- containerElement : createElement ( "div" , { } ) ,
137+ containerElement : createContainerElement ( "div" , { } ) ,
138138 application : "azure-devops" ,
139139 insertBefore : `div.bolt-header-command-item-button:has(button[id^="__bolt-header-command-bar-menu-button"])` ,
140140 manipulations : [
@@ -170,7 +170,7 @@ export const buttonContributions: ButtonContributionParams[] = [
170170 // "https://dev.azure.com/services-azure/test-project/_git/repo2/pullrequest/1"
171171 ] ,
172172 selector : ".repos-pr-header > div:nth-child(2) > div:nth-child(1)" ,
173- containerElement : createElement ( "div" , { } ) ,
173+ containerElement : createContainerElement ( "div" , { } ) ,
174174 application : "azure-devops" ,
175175 insertBefore : `div.bolt-header-command-item-button:has(button[id^="__bolt-menu-button-"])` ,
176176 } ,
@@ -179,7 +179,7 @@ export const buttonContributions: ButtonContributionParams[] = [
179179 exampleUrls : [ ] ,
180180 selector : "div.clone-with-application" ,
181181 application : "azure-devops" ,
182- containerElement : createElement ( "div" , { marginLeft : "4px" , marginRight : "4px" } ) ,
182+ containerElement : createContainerElement ( "div" , { marginLeft : "4px" , marginRight : "4px" } ) ,
183183 } ,
184184
185185 // GitLab
@@ -217,7 +217,7 @@ export const buttonContributions: ButtonContributionParams[] = [
217217 match : / \/ b l o b \/ / ,
218218 selector :
219219 "#fileHolder > div.js-file-title.file-title-flex-parent > div.gl-display-flex.gl-flex-wrap.file-actions" ,
220- containerElement : createElement ( "div" , { display : "inline-flex" , marginLeft : "8px" } ) ,
220+ containerElement : createContainerElement ( "div" , { display : "inline-flex" , marginLeft : "8px" } ) ,
221221 application : "gitlab" ,
222222 manipulations : [
223223 {
@@ -233,7 +233,7 @@ export const buttonContributions: ButtonContributionParams[] = [
233233 exampleUrls : [ "https://gitlab.com/svenefftinge/browser-extension-test/-/merge_requests/1" ] ,
234234 match : / \/ m e r g e _ r e q u e s t s \/ / ,
235235 selector : "#content-body > div.merge-request .js-issuable-actions" ,
236- containerElement : createElement ( "div" , { } ) ,
236+ containerElement : createContainerElement ( "div" , { } ) ,
237237 application : "gitlab" ,
238238 insertBefore : "#content-body > div.merge-request .js-issuable-actions > div.dropdown.gl-dropdown" ,
239239 manipulations : [
@@ -250,7 +250,7 @@ export const buttonContributions: ButtonContributionParams[] = [
250250 exampleUrls : [ "https://gitlab.com/svenefftinge/browser-extension-test/-/issues/1" ] ,
251251 match : / \/ i s s u e s (?: \/ \d + | \? ) / ,
252252 selector : "#content-body [data-testid='detail-wrapper'] > div > div:has(div > [data-testid='work-item-actions-dropdown'])" ,
253- containerElement : createElement ( "div" , { marginLeft : "0" , marginRight : "0px" } ) ,
253+ containerElement : createContainerElement ( "div" , { marginLeft : "0" , marginRight : "0px" } ) ,
254254 application : "gitlab" ,
255255 insertBefore : "#content-body [data-testid='detail-wrapper'] > div > div:has(div > [data-testid='work-item-actions-dropdown']) > div" ,
256256 } ,
@@ -264,7 +264,7 @@ export const buttonContributions: ButtonContributionParams[] = [
264264 "https://github.com/svenefftinge/browser-extension-test/tree/my-branch" ,
265265 ] ,
266266 selector : `xpath://*[contains(@id, 'repo-content-')]/div/div/div/div[1]/react-partial/div/div/div[2]/div[2]` ,
267- containerElement : createElement ( "div" , { } ) ,
267+ containerElement : createContainerElement ( "div" , { } ) ,
268268 additionalClassNames : [ "medium" ] ,
269269 application : "github" ,
270270 manipulations : [
@@ -289,7 +289,7 @@ export const buttonContributions: ButtonContributionParams[] = [
289289 ] ,
290290 selector : "#repo-content-pjax-container > div > div.commit.full-commit.mt-0.px-2.pt-2" ,
291291 insertBefore : "#browse-at-time-link" ,
292- containerElement : createElement ( "div" , {
292+ containerElement : createContainerElement ( "div" , {
293293 float : "right" ,
294294 marginLeft : "8px" ,
295295 } ) ,
@@ -302,7 +302,7 @@ export const buttonContributions: ButtonContributionParams[] = [
302302 exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/issues/1" ] ,
303303 selector : "[data-component='PH_Actions'] > div" , //
304304 insertBefore : "[data-component='PH_Actions'] > div > button" ,
305- containerElement : createElement ( "div" , { } ) ,
305+ containerElement : createContainerElement ( "div" , { } ) ,
306306 match : / \/ i s s u e s \/ / ,
307307 application : "github" ,
308308 additionalClassNames : [ "tall" ] ,
@@ -311,7 +311,7 @@ export const buttonContributions: ButtonContributionParams[] = [
311311 id : "gh-issue-new" , // this isn't referring to "new issue", but to new "issue"
312312 exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/issues/1" ] ,
313313 selector : `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div` ,
314- containerElement : createElement ( "div" , { } ) ,
314+ containerElement : createContainerElement ( "div" , { } ) ,
315315 insertBefore : `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div/div` ,
316316 application : "github" ,
317317 // we need to make the button higher: the buttons here use 2rem instead of 1.75rem
@@ -321,7 +321,7 @@ export const buttonContributions: ButtonContributionParams[] = [
321321 id : "gh-pull" ,
322322 exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/pull/2" ] ,
323323 selector : "#partial-discussion-header div.gh-header-show > div > div" ,
324- containerElement : createElement ( "div" , {
324+ containerElement : createContainerElement ( "div" , {
325325 order : "2" ,
326326 } ) ,
327327 match : / \/ p u l l \/ / ,
@@ -334,7 +334,7 @@ export const buttonContributions: ButtonContributionParams[] = [
334334 // "https://github.com/svenefftinge/browser-extension-test/pull/2/files" // this is an experiment for now, and we can't test against GitHub's feature flags yet
335335 ] ,
336336 selector : "div[data-component='PH_Actions']" ,
337- containerElement : createElement ( "div" , {
337+ containerElement : createContainerElement ( "div" , {
338338 order : "2" ,
339339 } ) ,
340340 match : / \/ p u l l \/ / ,
@@ -344,7 +344,7 @@ export const buttonContributions: ButtonContributionParams[] = [
344344 id : "gh-file" ,
345345 exampleUrls : [ "https://github.com/svenefftinge/browser-extension-test/blob/my-branch/README.md" ] ,
346346 selector : "#StickyHeader > div > div > div.Box-sc-g0xbh4-0.gtBUEp" ,
347- containerElement : createElement ( "div" , {
347+ containerElement : createContainerElement ( "div" , {
348348 marginLeft : "8px" ,
349349 } ) ,
350350 application : "github" ,
@@ -357,7 +357,7 @@ export const buttonContributions: ButtonContributionParams[] = [
357357 ] ,
358358 selector :
359359 "#repo-content-pjax-container > div > div.d-md-flex.flex-items-stretch.gutter-md.mb-4 > div.col-md-6.mb-4.mb-md-0 > div,#repo-content-turbo-frame > div > div.d-md-flex.flex-items-stretch.gutter-md.mb-4 > div.col-md-6.mb-4.mb-md-0 > div" ,
360- containerElement : createElement ( "div" , { } ) ,
360+ containerElement : createContainerElement ( "div" , { } ) ,
361361 application : "github" ,
362362 manipulations : [
363363 {
@@ -387,7 +387,7 @@ export const buttonContributions: ButtonContributionParams[] = [
387387 selector :
388388 "#main > div.aui-toolbar2.branch-selector-toolbar > div > div.aui-toolbar2-primary > div > div:nth-child(1) > div" ,
389389 insertBefore : "#branch-actions" ,
390- containerElement : createElement ( "div" , {
390+ containerElement : createContainerElement ( "div" , {
391391 marginLeft : "2px" ,
392392 } ) ,
393393 application : "bitbucket-server" ,
@@ -402,7 +402,7 @@ export const buttonContributions: ButtonContributionParams[] = [
402402 selector : "#pull-requests-container > header > div.pull-request-header-bar > div.pull-request-actions" ,
403403 insertBefore :
404404 "#pull-requests-container > header > div.pull-request-header-bar > div.pull-request-actions > div.pull-request-more-actions" ,
405- containerElement : createElement ( "div" , {
405+ containerElement : createContainerElement ( "div" , {
406406 marginLeft : "2px" ,
407407 } ) ,
408408 application : "bitbucket-server" ,
@@ -419,7 +419,7 @@ export const buttonContributions: ButtonContributionParams[] = [
419419 selector : 'xpath://*[@id="main"]/div/div/div[1]/div/header/div/div/div/div[2]/div' ,
420420 insertBefore :
421421 "#main > div > div > div.css-1m2ufqk.efo6slf1 > div > header > div > div > div > div.css-1ianfu6 > div > div:nth-child(2)" ,
422- containerElement : createElement ( "div" , {
422+ containerElement : createContainerElement ( "div" , {
423423 marginLeft : "2px" ,
424424 } ) ,
425425 application : "bitbucket" ,
@@ -430,7 +430,7 @@ export const buttonContributions: ButtonContributionParams[] = [
430430 // "https://bitbucket.org/efftinge/browser-extension-test/pull-requests/1"
431431 ] ,
432432 selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div/div[1]/div/div[2]/div/div[2]/div/div' , // grandparent div of the "Request changes" and "Approve" buttons
433- containerElement : createElement ( "div" , { } ) ,
433+ containerElement : createContainerElement ( "div" , { } ) ,
434434 insertBefore :
435435 'xpath:(//*[@id="main"]/div/div/div[1]/div/div/div/div[1]/div/div[2]/div/div[2]/div/div/div)[last()]' , // note the [last()] to insert before the last child (the kebab menu)
436436 application : "bitbucket" ,
@@ -442,7 +442,7 @@ export const buttonContributions: ButtonContributionParams[] = [
442442 // "https://bitbucket.org/efftinge/browser-extension-test/branch/my-branch"
443443 ] ,
444444 selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div[2]/div/div' , // action bar section with the last action of "Settings"
445- containerElement : createElement ( "div" , {
445+ containerElement : createContainerElement ( "div" , {
446446 marginLeft : "2px" ,
447447 } ) ,
448448 application : "bitbucket" ,
@@ -452,7 +452,7 @@ export const buttonContributions: ButtonContributionParams[] = [
452452 match : / \/ c o m m i t s \/ ( .+ ) ? / ,
453453 exampleUrls : [ "https://bitbucket.org/efftinge/browser-extension-test/commits/" ] ,
454454 selector : 'xpath://*[@id="main"]/div/div/div[1]/div/div/div[1]/div[1]/div[2]/div' ,
455- containerElement : createElement ( "div" , {
455+ containerElement : createContainerElement ( "div" , {
456456 marginLeft : "2px" ,
457457 } ) ,
458458 application : "bitbucket" ,
0 commit comments