Inject browser script in Siebel 8.1.1.2

I dont know how many customers are on 8.1.1.2, but i suspect not many since its only available to the Public Sector vertical. But this could be the beginning of the end for all the browser script hackers out there.

Injecting browser script into the IE address bar has been a favourite trick for developers to Set and Get the value of profile attributes on the fly.

If you've come late to the party, what this trick does is allow us to run browser script against the current siebel session using the following javascript command

javascript: alert(theApplication().GetProfileAttr("Me.Full Name"));


The first signs of problems began in 8.1.1.1 when the Siebel UI rejected my attempts to insert the Impossible Toolbar into the menu frame, which i thought were related to me upgrading to IE8, but in 8.1.1.2 it disabled any injection attempts altogether, as verified by @lex on my Twitter.

I've been secretly playing with a web development trick to inject browser script into Siebel, and reimplementing my tools around this new method.

This is only high level information, but there are a couple ways of running achieving this.

1. Build a browser console

On Application Start, write some code in browser script that opens up an IE window. This IE window exposes a console that runs code in the context of the parent window.

This allows us to hook into the Siebel session, and run our commands in the same fashion that the address bar allowed previously.

You could also modify the Siebel browser script framework files to open up the console, instead of modifying the application, but the downside is neither of these method are very portable.

2. Use a browser debugger

This method affords us the flexibility to inject browser script in any environment, but lacks the flexibility to customize the UI and commands needed to perform a lot of the fancy stuff that the Impossible Siebel toolbar provided.

I am currently looking at a fusion of the above techniques, and have managed to port some essential features of the Impossible Siebel toolbar onto a separate floating console as a POC.

Heres an early prototype that i've hacked onto a log4javascript console.



But, if all you are interested in is Setting and Getting ProfileAttr in Siebel, you can download any debugger (google is your friend), and try it out on your machine, as long as it provides you with a console, you can use it to run Browser Script commands.

Its actually easier than using the address bar, because you dont have to type the "javascript:" prefix in front of all your commands.

Even if you dont have the 8.1.1.2 problem, i recommend you grab one of these tools, it will become indispensible when you need to debug browser script, find the source code of individual frames, or just check profile attributes to test that your config is behaving correctly.


Reactions:

4 comments:

  1. Hi Jason,

    just my 2c: 8.1.1.2 is a patch on 8.1.1.x and not on Siebel 8.2 (the Public Sector release you're referring to).

    Being picky, I know ;-)

    have a nice day

    @lex

    ReplyDelete
  2. Hi @lex,

    thanks for clearing that up.

    Jason

    ReplyDelete
  3. Hey Jason,

    The BS/js injection works on v8.1.1.1 and v8.2 flawlessly. Maybe the restriction is specific to v8.1.1.2 patch.Also I have some info on this on my blog.

    geeksajan
    http://geeksajan.blogspot.com

    ReplyDelete
  4. Hi Sajan

    The problem is specific to 8.1.1.2.

    You can inject javascript into 8.1.1.1, but as mentioned, it rejected my attempts to alter the menu frame.

    Keep in mind that Siebel uses dynamic frames, so svf0 will be recycled.

    Good to see that you are having fun with your consoles.

    Jason

    ReplyDelete

Comments are open to all, please make it constructive.