Allow JS Injection to work properly when MDS is disabled or has failed back
Merge remote-tracking branch 'contributor/dev' into pr279
merged pr279 + additional changes to make the sample more reliable in all scenarios