It has a web page using MircrosoftAjax to create the confirmation dialog that ComponentID could be found by $find (or Sys.Application.findComponent) in Chrome console and Sys.Application.getComponents got the ID Component list as well,but when I moved the code injecting into Content Script of Chrome extension,The result always returned 'NULL' except for DOM operation . I just want to change the Component's property to achieve automatical confirmation without manual clicking,but it seems hard to do. This is my code:
$(document).ready(function(){
Sys.Application.getComponents() //return 'NULL'
Sys.Application.findComponent('sth')._ConfirmOnFormSubmit=true //return 'Cannot set property '_ConfirmOnFormSubmit' of null '
})
function pageLoad(sender,args) {
//Sys.Application.initialize()
console.log($find('sth')) //return 'NULL'
function confirm() {return true} //seems to approach the fact working well that bypassed the dialog in chrome console but still not working in Content Script
}
Why has the different result between Content and Console? How should I do the right way?
I appreciate so much if someone can give me a solution.
Best Regards.