add google in a tab (or some other site)

lisas4567

Member
May 25, 2018
773
0
16
** I DIDNT WRITE THIS, ALL CREDIT GOES TO NOVIK **

anyways, i'd like to share it because it's been of great use to me.

this only works with svn versions of rutorrent. It should also work on 2.8 when it drops.

go to your rutorrent files, in the plugin dir and make a new dir called new_tab
Code:
mkdir new_tab
Code:
cd new_tab
vi init.js
now add this to the init.js file
Code:
utWebUI.addNewTabWithURL = function( tabName, tabURL )
{
var frame = document.createElement("IFRAME");
frame.src = tabURL;
frame.id = "new_url";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
var plugin = new rPlugin("new_tab");
plugin.attachPageToTabs(frame,tabName);
}

utWebUI.addNewTabWithURL( "Google", "http://www.google.us" );

you can add multiple tabs in this way, just make a new_tab2 dir and add a new init.js with this info
Code:
utWebUI.addNewTab2WithURL = function( tabName, tabURL )
{
var frame = document.createElement("IFRAME");
frame.src = tabURL;
frame.id = "new_url2";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
var plugin = new rPlugin("new_tab2");
plugin.attachPageToTabs(frame,tabName);
}

utWebUI.addNewTab2WithURL( "Forums", "http://forums.rutorrent.org" );
 
Last edited:

simur612

Member
May 25, 2018
879
0
16
Hi there Wonslung, great idea, but rutorrent webui seems to hang once I refresh the page, and doesnt load. When I remove the newtab its fine. Any ideas?
 

simur612

Member
May 25, 2018
879
0
16
i dunno what to tell you, this works on numerous installed past svn 498 or maybe even before that.

are you sure you've done everything correctly?


try removing the ^M's maybe...
 

randac56

Member
May 25, 2018
915
0
16
here, just untar this in rtorrent/plugins/

if it doesn't work, then you're install is borked. This works on every install i've tried which is a LOT.


also, when i say latest svn i mean rutorrent svn, not rtorrent svn (though rtorrent svn is fine)
 

saroos1

Member
May 25, 2018
718
0
16
here, just untar this in rtorrent/plugins/

if it doesn't work, then you're install is borked. This works on every install i've tried which is a LOT.


also, when i say latest svn i mean rutorrent svn, not rtorrent svn (though rtorrent svn is fine)
It works a treat, the reason mine didn't work is because I copy and pasted your first init.js file which contains ^M...lol
That was the problem!

Thanks again...awesome work smiley.gif
 

randac56

Member
May 25, 2018
915
0
16
this is the updated info for 3.0

create the dir new_tab in your plugins dir

create 2 files, init.js and plugin.info
this is init.js
Code:
var frame = null;

plugin.addNewTabWithURL = function( tabName, tabURL )
{
frame = document.createElement("IFRAME");
frame.name = "new_url";

frame.src = tabURL;
frame.id = "new_url";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
this.attachPageToTabs(frame,tabName);
}

theTabs.onShow = function(id)
{
if(id=="new_url")
{
frame.src = "https://someURL/?time=" + (new
Date()).getTime();
}
}

plugin.addNewTabWithURL( "URL TAB NAME", "https://someURL/" );



and this is plugin.info
Code:
description: a plugin
author: you
version: 1.0
 

lisas4567

Member
May 25, 2018
773
0
16
Great Infomation about adding tabs Thanks

I have added a tab for a shout box to my page and was wondering if there is a small hack to allow this tab to be the default tab when rutorrent is loaded.
 

peshua19

Member
May 25, 2018
897
0
16
to allow this tab to be the default tab when rutorrent is loaded.
Add to code
Code:
plugin.show = theWebUI.show;
theWebUI.show = function()
{
plugin.show.call(this);
theTabs.show("new_url");
}
fo this. I don't tried, but guess, this will work.
 

saroos1

Member
May 25, 2018
718
0
16
hi,

I would like to use this tips to display a web page wich url look like this :

https://someURL/?host=<hostname>&user=<webuser>

with hostname of the machine and webuser authentified for this session.

How can i grab this info? Is it in php, java, unix, anything else?

Thx for your clue
 

randac56

Member
May 25, 2018
915
0
16
i think it would depend on the TYPE of authentication needed for the page.
The page doesn't need authentification. It's the hostname of the machine where rutorrent is installed and webuser is the rutorrent user.

If it's what you ask, I use htdigest to log in rutorrent.

I want to use a tab like you write :
Code:
theTabs.onShow = function(id)
{
if(id=="new_url")
{
frame.src = "https://someURL/?time=" + (new
Date()).getTime();
}
}
Tx
 

simur612

Member
May 25, 2018
879
0
16
hej,

i know this topic is rather old but i was interested in that, so i tried it out:

not working in SVN 3.6 just to inform you and to get - if any - new info about that.