Get API link in Viewer

Currently we can set API link only manually. So, this PR provide some functional that help us get API link directly from Viewer.
And this provide cookie hack that let us get API link without any proxy/VPN!

Code may be looks a ugly but I don't know other workarounds for getting loadFinished-signal from specific frame/iframe (that contains HTML with swf and API data).

Because my english is poor - please check text in settings.
I'm not sure.
We can receive loadFinished signal but this is not guarantee that JS on frame successfully executed. So I wait while JS will be executed and create flash object.