File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 3
3
constructor ( ) {
4
4
super ( 'example-extension' ) ;
5
5
this . element = this . addMenuEntry ( 'Example Extension' ) ;
6
+ this . content = '' ;
7
+
8
+ fetch ( `/extensions/${ this . id } /views/content.html` )
9
+ . then ( ( res ) => res . text ( ) )
10
+ . then ( ( text ) => this . content = text )
11
+ . catch ( ( e ) => console . error ( 'Failed to fetch content:' , e ) ) ;
6
12
}
7
13
8
14
show ( ) {
9
- const content = `<div id="extension-example-extension-content">
10
- <h1>Hello, world!</h1>
11
- </div>` ;
12
-
13
- this . element . innerHTML = content ;
15
+ this . element . innerHTML = this . content ;
14
16
}
15
17
}
16
18
Original file line number Diff line number Diff line change 28
28
"web_accessible_resources" : [
29
29
" css/*.css" ,
30
30
" images/*.svg" ,
31
- " js/*.js"
31
+ " js/*.js" ,
32
+ " views/*.html"
32
33
]
33
34
}
Original file line number Diff line number Diff line change
1
+ < div id ="extension-example-extension-content ">
2
+ < h1 > Hello, world!</ h1 >
3
+ </ div >
You can’t perform that action at this time.
0 commit comments