File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,11 @@ function RunWhenReady(selectors, code) {
199
199
if ( typeof selectors == "string" ) {
200
200
selectors = [ selectors ] ;
201
201
}
202
- DebugLog ( "RunWhenReady(): Running on [\"" + selectors . join ( "\", \"" ) + "\"], code = ```\n" + code + "\n```" ) ;
202
+ try {
203
+ DebugLog ( "RunWhenReady(\"" + selectors . join ( "\", \"" ) + "\"): Run from " + ( new Error ) . stack . split ( "\n" ) [ 1 ] . split ( "/" ) [ 4 ] ) ;
204
+ } catch ( TypeError ) {
205
+ DebugLog ( "RunWhenReady(\"" + selectors . join ( "\", \"" ) + "\"): Running..." ) ;
206
+ }
203
207
204
208
var loadedElement , isLoaded ;
205
209
function GetLoadedElement ( mutationInstance = null ) {
@@ -208,7 +212,7 @@ function RunWhenReady(selectors, code) {
208
212
loadedElement = document . querySelector ( selectors [ i ] )
209
213
} catch ( TypeError ) { }
210
214
if ( loadedElement != null ) {
211
- DebugLog ( "RunWhenReady(): Element with selector \"" + selectors [ i ] + "\" loaded.. ." ) ;
215
+ DebugLog ( "RunWhenReady(\"" + selectors . join ( "\", \"" ) + "\"): Loaded ." ) ;
212
216
code ( loadedElement ) ;
213
217
if ( mutationInstance != null ) { // Running in observer:
214
218
mutationInstance . disconnect ( ) ;
You can’t perform that action at this time.
0 commit comments