Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 29, 2013 @ 08:55
    Stefan Kip
    0

    Inject javascript in umbraco.aspx

    Hi all,

    I'd like to inject a javascript reference in the /umbraco/umbraco.aspx page, without modifying the source.
    Is this possible somehow?

    Thanks!

  • Rich Green 2246 posts 4006 karma points
    Aug 29, 2013 @ 09:11
  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 29, 2013 @ 09:17
    Stefan Kip
    0

    Seems helpful yes, I'll look into it soon, thanks!

    Edit: I've taken a quick look at it and it seems quite overpowered for this simple task. Isn't there an easier way? I thought there were some events you could subscribe to in a ApplicationEventHandler?

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 29, 2013 @ 09:22
    Sebastiaan Janssen
    1

    Use a FormRewriterControlAdapter (see the App_Browsers folder in any Umbraco install).

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 29, 2013 @ 09:24
    Sebastiaan Janssen
    1

    Check this out as well, my environmentindicator did just that: http://pagenotifications.codeplex.com/SourceControl/latest#App_ Browsers/environmentIndicator.browser

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 29, 2013 @ 09:31
    Stefan Kip
    0

    Thanks Sebastiaan, looks good!

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Aug 29, 2013 @ 16:13
    Lee Kelleher
    0

    @Seb - I didn't know that the controlAdapters could be used against pages (guess I never tried that), always thought they were for smaller controls. You learn something new everyday! #h5yr

    @Stefan - before seeing Seb's suggestion, if not wanting to use BackOfficePowerScripts - then the only other way that I've done it is using a HttpModule to apply a Response.Filter against the rendered mark-up. It's hacky as hell, but works, (see my old/hacky Disable BackOffice Timeout package for an example.)

    Cheers,
    - Lee

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies