Access Denied

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chico Che

    Access Denied

    I have a ie window that launches a pop up window with no menus/toolbars
    nothing just the page. When I run an bookmarklet on main window it works
    fine but when I try running this on the popup I get an access denied error.
    All the javascript is doing is getting innertxt from a textbox. It works
    fine when main window is done but when popup is used it does not work. If
    anybody can help would greatly appreciate it.
  • Stevo

    #2
    Re: Access Denied

    Chico Che wrote:
    I have a ie window that launches a pop up window with no menus/toolbars
    nothing just the page. When I run an bookmarklet on main window it works
    fine but when I try running this on the popup I get an access denied error.
    All the javascript is doing is getting innertxt from a textbox. It works
    fine when main window is done but when popup is used it does not work. If
    anybody can help would greatly appreciate it.
    Looking at your code, I see that your problem is with ..... oh wait,
    there is no code to look at. In that case, I'm going to take a guess at
    the problem being on line 37.

    Comment

    • Chico Che

      #3
      Re: Access Denied

      Stevo <no@mail.invali dwrote in news:g3rl62$ced $01$1@news.t-online.com:
      Chico Che wrote:
      >I have a ie window that launches a pop up window with no
      >menus/toolbars nothing just the page. When I run an bookmarklet on
      >main window it works fine but when I try running this on the popup I
      >get an access denied error. All the javascript is doing is getting
      >innertxt from a textbox. It works fine when main window is done but
      >when popup is used it does not work. If anybody can help would
      >greatly appreciate it.
      >
      Looking at your code, I see that your problem is with ..... oh wait,
      there is no code to look at. In that case, I'm going to take a guess
      at the problem being on line 37.
      >
      My bad here is the code:

      [InternetShortcu t]
      URL=javascript: var d=document;var df = document.frames ;var screen = "Not
      Found"; var id = "@$@OBJ0000 2[1]";if(df.len gth != 0){df[0].focus();for (f=
      0; f< df.length;f++){ var scrvalue = df[f].document.getEl ementById(id);i f
      (scrvalue != null){screen = scrvalue.innerT ext;}}}else{var scrvalue =
      d.getElementByI d(id);if (d!= null){screen = scrvalue.innerT ext}}alert
      (screen);
      Modified=307DA7 9EA1BBC10110
      IconIndex=3
      IconFile=C:\WIN NT\System32\url .dll

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Access Denied

        Chico Che wrote:
        Stevo wrote:
        >Chico Che wrote:
        >>I have a ie window that launches a pop up window with no
        >>menus/toolbars nothing just the page. When I run an bookmarklet on
        >>main window it works fine but when I try running this on the popup I
        >>get an access denied error. All the javascript is doing is getting
        >>innertxt from a textbox. It works fine when main window is done but
        >>when popup is used it does not work. If anybody can help would
        >>greatly appreciate it.
        >[...]
        >
        [...] var d=document;var df = document.frames ;var screen = "Not
        Found"; var id = "@$@OBJ0000 2[1]";if(df.len gth != 0){df[0].focus();for (f=
        0; f< df.length;f++){ var scrvalue = df[f].document.getEl ementById(id);i f
        (scrvalue != null){screen = scrvalue.innerT ext;}}}else{var scrvalue =
        d.getElementByI d(id);if (d!= null){screen = scrvalue.innerT ext}}alert
        (screen);
        The code doesn't handle the case that `scrvalue' is not an object reference
        (e.g. is `null) because there is no element with that ID. The assignment

        screen = scrvalue.innerT ext;

        results in a TypeError (in IE: "Object expected") then. This is what
        happened when I used the bookmarklet on an arbitrary document in
        "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; ...; .NET CLR 1.1.4322;
        ..NET CLR 2.0.50727)".

        Anything else is specific to the document you are viewing; you should post
        the URL of the opener. However, a likely cause of the error message is that
        the supposed frame's content document is accessed through a domain different
        from the domain of the popup document. This would be a security precaution,
        by design, and cannot be reliably worked around.

        Also, `document.frame s' should be `window.frames' , and `screen' should be
        something else (as there is a host-defined property of the Global Object
        with that name already).


        PointedEars
        --
        Prototype.js was written by people who don't know javascript for people
        who don't know javascript. People who don't know javascript are not
        the best source of advice on designing systems that use javascript.
        -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

        Comment

        • dhtml

          #5
          Re: Access Denied

          On Jun 24, 2:29 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
          wrote:
          Chico Che wrote:
          Stevo wrote:
          Chico Che wrote:
          Also, `document.frame s' should be `window.frames' , and `screen' should be
          something else (as there is a host-defined property of the Global Object
          with that name already).
          >
          Alternatively, the code can be wrapped in a function:-

          (function(){ /* bookmarklet code here */ })();

          To avoid polluting or colliding with global namespace.

          Garrett
          PointedEars

          Comment

          Working...