dcsimg
www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 23

Thread: disable javascript in iframe

  1. #1
    Join Date
    Nov 2007
    Posts
    9

    Question disable javascript in iframe

    is it possible to disable javascript inside an iframe plz?

    klmdb

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    disabling javascript is the privilege of the user, and it is a facility of the browser. You can not force enabling/disabling javascript on the user's browser... Why do you need that? Maybe we could find another way
    Last edited by Kor; 11-12-2007 at 10:35 AM.

  3. #3
    Join Date
    Nov 2007
    Posts
    9
    I'm trying to load a page into an iframe, but since that page has a function to automatically redirect outside of any frame, I need to disable javascript.

  4. #4
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    The short answer is: You can not. It's impossible, AFAIK. Anyway, it is not ethical...
    Last edited by Kor; 11-12-2007 at 11:12 AM.

  5. #5
    Join Date
    Nov 2007
    Posts
    9
    impossible is a strong word...

    I never though something could actually be impossible in programming. Anyone could find a solution anyway? maybe by buffering the code, and deleting the javascript before showing it in the iframe?

  6. #6
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    it is more than possible to do using a server side language, but javascript between servers is very restricted if existent.

  7. #7
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    For obvious security reasons, browsers are instruct not to establish javascript relationship from one domain to another. In fact you can modify nothing on a page outside your domain.

    The only reasonable way I can see is to hack that page and to remove physically that javascript code. . Upon my knowledge there is nothing else you can do...

  8. #8
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    you may copy the content of another domain's page using a server-side intermediate application and later to remove the javascript code and post the content on your page, but this is to be done only if the third part server does accept this kind of request (as scragar said)....

  9. #9
    Join Date
    Feb 2006
    Posts
    2,927
    If the remote page is using javascript to redirect, you can keep it in the frame on your page if you disable javascript in your browser.

  10. #10
    Join Date
    Nov 2007
    Posts
    9
    Quote Originally Posted by mrhoo
    If the remote page is using javascript to redirect, you can keep it in the frame on your page if you disable javascript in your browser.
    this I know, but it keeps me from using my own js functions
    Last edited by klmdb; 11-12-2007 at 11:42 AM.

  11. #11
    Join Date
    Nov 2007
    Posts
    9
    if anyone cares:

    I solved the problem by creating a proxy script. I can now buffer the code before I show it, and filter everything out that I dont want to use; ie. I remove the javascript and tadaa: I've got myself an iframe without javascript

  12. #12
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    If a page reloads itself when you try to load it in a frame then the page owner is making it clear that they do not give permission to display it in a frame. Bypassing their processing to then force it into a frame without the owner's permission is called STEALING.

  13. #13
    Join Date
    Nov 2007
    Posts
    36
    Quote Originally Posted by klmdb
    if anyone cares:

    I solved the problem by creating a proxy script. I can now buffer the code before I show it, and filter everything out that I dont want to use; ie. I remove the javascript and tadaa: I've got myself an iframe without javascript
    good call. glad it worked.

  14. #14
    Join Date
    May 2008
    Posts
    1
    Quote Originally Posted by klmdb
    if anyone cares:

    I solved the problem by creating a proxy script. I can now buffer the code before I show it, and filter everything out that I dont want to use; ie. I remove the javascript and tadaa: I've got myself an iframe without javascript
    Would you plz tell me how you did so? I have the same problem

  15. #15
    Join Date
    May 2008
    Posts
    3

    Cool

    Way to stick it to the man...great idea! I'd love to do this as well. Plz share!!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles