문제

I'm try to use accelerator Titanium to add native commands to a webapp.

http://appcelerator.com/

I'm changing the window location to an external website like this:

window.location = http://site.com;

I want to bind events on that website.

$('a').click(function () {
  alert('clicked');
});

The site has jquery loaded, the index.html also has jQuery included. But I suppose the index.html having jQuery has nothing to do with it since I changed the location already.

In any case the above does not work.

Can anyone tell me if it's possible.

To rephrase, what I want to do is use custom javascript and titanium commands on a website, sort of like a browser plugin?

Can anyone help with this?

Thanks.

도움이 되었습니까?

해결책

If I understand correctly you want to do something like Greasemonkey does for Firefox. The problem is that you can not do such a thing because of browser restriction. What you are trying to do is the same thing as attackers do when they are exploiting XSS vulnerabilities.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top