C# GeckoFX web browser - Remove http from textbox -


i'm working on web browser. once textbox isn't selected anymore should remove http:// , last /. i'm using leave method of textbox. code works fine normal webbrowser.

        if (w.documenttitle != "")         {             q.text = "" + w.url;             q.text = q.text.replace("http://www.", "");             q.text = q.text.replace("https://www.", "");             q.text = q.text.replace("http://", "");             q.text = q.text.replace("https://", "");             if (q.text.endswith("/"))             {                 q.text = q.text.substring(0, q.text.length - 1);             }         } 

in geckofx textbox still displays http:// , /!?!?!

if want take domain name try this

q.text = mygeckowebbrowser.url.domain; 

if want local path try this

q.text = mygeckowebbrowser.url.localpath; 

and if want both try this

q.text = mygeckowebbrowser.url.domain + '' + mygeckowebbrowser.url.localpath; q.text = q.text.replace("www","")' 

i hope helps


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -