开发者

How to make cross-frame-scripting work locally

I want to load a page on the intranet and login automatically but this error happens in Firefox 4 due to the cross-f开发者_如何学编程rame-scripting-policy:

Permission denied to access property 'LoginForm'

How can I work around that or are there alternative ways to achieve that?

Don't lecture me on the security problems this may cause! I know the risk myself, but since this computer doesn't have any access to the internet it doesn't matter.

Here's how I tried to make it work:

<frameset cols="500,*">
    <frame src="script.html" name='leftFrame'>
    <frame src='http://intranet/login/' name='login'>
</frameset>

script.html looks like this:

<form>
    <input type="button" value="Login" 
        onClick="parent.login.LoginForm.password.value='MYPASSWORD'">
</form>


The best way is to place the file in that server and run it ...

No matter what will you try, you will end up getting such error as that's a javascript violation, not machine/browser setting.

Changing things locally and update to server upon Save, and test some more

With Expresso, Coda, etc it's easy to do that, they will upload the file to FTP on each Save File iteration.


The right way to do this is to run privileged code for the login bit. That is, instead of a file:// web page, use an extension.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜