File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -170,11 +170,17 @@ webrtcperf.overrideLocalStorage = window.overrideLocalStorage = () => {
170
170
}
171
171
}
172
172
173
- webrtcperf . injectCss = window . injectCss = css => {
174
- const style = document . createElement ( 'style' )
175
- style . setAttribute ( 'type' , 'text/css' )
173
+ webrtcperf . injectCss = window . injectCss = ( css , id = 'custom' ) => {
174
+ id = `webrtcperf-css-${ id } `
175
+ let style = document . getElementById ( id )
176
+ if ( ! style ) {
177
+ style = document . createElement ( 'style' )
178
+ style . setAttribute ( 'id' , id )
179
+ style . setAttribute ( 'type' , 'text/css' )
180
+ document . head . appendChild ( style )
181
+ }
176
182
style . innerHTML = css
177
- document . head . appendChild ( style )
183
+ return style
178
184
}
179
185
180
186
webrtcperf . watchObjectProperty = window . watchObjectProperty = ( object , name , cb ) => {
You can’t perform that action at this time.
0 commit comments