I would like to select the frame hosting the 'Dashboard.aspx' page using the Tridion Anguilla JS framework.

Chrome detects 3 frames (with the last being the dashboard) and Firefox detects 2 frames.

Is it possible to refer to the dashboard frame other than the position in the frames array?

Chrome:

var dashChrome = window.top.frames[2]

Firefox:

var dashFF = window.top.frames[1]
up vote 6 down vote accepted

I might be wrong, but assuming you are working on Bookmarklet challenge :) here you go: you can use View Id identifier, which is a $display.getView().getId() == "DashboardView"

And here is the bookmarklet:

javascript: (function (UI, B, e, a, r, d)
{
    try
    {
        while (r = UI.frames[e++])
        {
            if ((a = r.$display && r.$display.getView()) && a.getId() == B)
            {
                d = a;
                break;
            }
        }

        console.log(d);
    }
    catch (x) {};
})(window.top, 'DashboardView', 0)
  • You're absolutely correct, I'm taking a stab at the bookmarklet challenge. Thanks to your code my solution is a lot less hackish than before :) – robrtc Dec 18 '14 at 13:10
  • 3
    Nice arguments :D – Peter Kjaer Dec 18 '14 at 13:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.