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.
This is a lot of indenting, in a part you never actually change… =w=