File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
apps/extension/src/providers/list Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,41 @@ import { ProviderInterface } from "@gitroom/extension/providers/provider.interfa
33export class YoutubeProvider implements ProviderInterface {
44 identifier = "youtube" ;
55 baseUrl = "https://www.youtube.com" ;
6- element = `ytd-topbar-menu- button-renderer button[aria-label^="Create"] ` ;
6+ element = `#postiz- button` ;
77 attachTo = `#end` ;
88 style = "dark" as "dark" ;
99
1010 findIdentifier = ( element : HTMLElement ) => {
1111 const match = window . location . href . match ( / v = ( [ \w - ] { 11 } ) / ) ;
1212 return match ? match [ 1 ] : window . location . href ;
1313 } ;
14+
15+ onLoad = ( ) => {
16+ const container = document . querySelector ( this . attachTo ) ;
17+ if ( ! container || document . querySelector ( "#postiz-button" ) ) return ;
18+
19+ const button = document . createElement ( "button" ) ;
20+ button . id = "postiz-button" ;
21+ button . style . cssText = `
22+ background: none;
23+ border: none;
24+ cursor: pointer;
25+ margin-left: 8px;
26+ display: flex;
27+ align-items: center;
28+ ` ;
29+
30+ const img = document . createElement ( "img" ) ;
31+ img . src = "https://raw.githubusercontent.com/gitroomhq/postiz-app/main/assets/logo.svg" ;
32+ img . alt = "Postiz" ;
33+ img . style . cssText = "height: 24px; width: 24px;" ;
34+
35+ button . appendChild ( img ) ;
36+ container . appendChild ( button ) ;
37+
38+ button . addEventListener ( "click" , ( ) => {
39+ // Trigger Postiz UI
40+ // This should call the method that opens the Postiz interface
41+ } ) ;
42+ } ;
1443}
You can’t perform that action at this time.
0 commit comments