gEdit Browser Preview plugin
Wednesday, 14. November 2007, 20:56:01
How it works:
* you have to install all the browsers on your system
* Internet Explorer 6 support is done by IEs4Linux in standard configuration and includes path converting
* Copy the files browser.gedit-plugin and browser.py into ~/.gnome2/gedit/plugins
* Start gEdit and enable the plugin "Browser Preview" in the preferences
* After a restart the plugin appears in the View menu
* Assign the typical shortcuts "F12", "Ctrl+F12" etc. to the different Browsers in the menu
Download:
http://files.myopera.com/area42/files/gedit_browser_plugin.zip
gEdit plugins i wrote too:
http://my.opera.com/area42/blog/gedit-language-reference-plugin
http://my.opera.com/area42/blog/gedit-template-plugin
A lot of other gEdit plugins can be found here.








Anonymous # 17. April 2008, 10:33
Thanks, usefull plugin!
But...
...is not possible realtime preview like textmate?
Eckhard M. Jäger # 17. April 2008, 11:01
Nice idea but then i have to add a panel and there i have to integrate webkit or gecko and then i have to build a pip for realtime changes - huh man that's very hard ro code
Anonymous # 20. May 2008, 01:44
the link is broken, it points to the reference plugin
Eckhard M. Jäger # 20. May 2008, 07:59
thanx, fixed.
Anonymous # 23. May 2008, 17:32
How do I set up shortcuts for each browser?
Thanks
Eckhard M. Jäger # 23. May 2008, 17:54
Anonymous # 24. May 2008, 20:05
How do I enable dynamic shortcuts? I can't seem to get it to work?
Eckhard M. Jäger # 25. May 2008, 11:07
http://blogs.gnome.org/thos/files/2007/05/Screenshot-Appearance%20Preferences-4.png
Activate the checkbox "Editable ..."
Anonymous # 25. May 2008, 15:13
very good thank you. works great
Anonymous # 15. June 2008, 00:46
Thank you so much for your great plugin.
Under firefox, i refresh automatically the tabs with "tab mix plus,
and if gedit was able of having an autosave feature for each modification to the document (gedit would be like the excellent textmate with its best feature "autopreview function".
Or maybe is it possible to choose an autosave period much shorter (because 1 minute... is not like real time :) )
Do you know a way for this?
Thank you
Eckhard M. Jäger # 15. June 2008, 08:59
About Autosave, there is no way using secounds. I tried modify it using gconf but its defined as an integer. May something for the bug tracker > Feature request
Here are two other tips about gEdit:
add to "/apps/gedit-2/preferences/editor/save" at the key "writable_vfs_schemes" the entry "ftp" to allow ftp connection from gEdit.
set "max_recents" at "/apps/gedit-2/preferences/ui/recents" up 15 to get a longer list of rescent opened files.
Happy computing
Anonymous # 15. June 2008, 16:15
Thank you for the tips.
My .gconf/apps/gedit-2/preferences/editor/save/%gconf.xml
Is now like that :
ssh
sftp
smb
dav
davs
ftp
And... It's greeat :)
Anonymous # 23. September 2008, 01:54
So you have to install all of the browsers, even if you won't use all of them? I followed the instructions (except for installing all of the browsers), but nothing happens when I click View > View in > Firefox or when I press F9 (the shortcut I assigned to Firefox). Also, does this plugin display the given file within a browser embedded in Gedit, or does it simply display the given file in a regular, separate browser window?
Eckhard M. Jäger # 23. September 2008, 20:37
thanks for your feedback. First of all you must not have all these browsers installed. The plugins calls a browser and did not embed it in the bottom panel. There is another plugin that tried that (but just one browser).
What is the output when you start gEdit via the shell? Is there any error message?
Anonymous # 27. September 2008, 00:12
Sorry for the late reply--yes, the following is output when I try to view in Firefox (I do not have the other browsers installed):
Traceback (most recent call last):
File "/home/chris/.gnome2/gedit/plugins/browser.py", line 93, in
lambda a: self._plugin.on_browser_activate(self._window)),
File "/home/chris/.gnome2/gedit/plugins/browser.py", line 151, in on_browser_activate
parts = string.split(url,"//")
File "/usr/lib/python2.5/string.py", line 290, in split
return s.split(sep, maxsplit)
AttributeError: 'NoneType' object has no attribute 'split'
Eckhard M. Jäger # 27. September 2008, 19:35
thanks for the trace, i will try to debug it.
Anonymous # 5. January 2009, 18:25
I have the same problem that Fervin does. Nothing happens when I try to view a html file with Firefox. I get exactly the same output when I start gedit in a bash shell.
Anonymous # 5. January 2009, 18:26
This is the output:
kurt@kurt-desktop:~$ gedit
Traceback (most recent call last):
File "/home/kurt/.gnome2/gedit/plugins/browser.py", line 93, in
lambda a: self._plugin.on_browser_activate(self._window)),
File "/home/kurt/.gnome2/gedit/plugins/browser.py", line 151, in on_browser_activate
parts = string.split(url,"//")
File "/usr/lib/python2.5/string.py", line 290, in split
return s.split(sep, maxsplit)
AttributeError: 'NoneType' object has no attribute 'split'
kurt@kurt-desktop:~$
Anonymous # 5. January 2009, 19:09
For some reason, it is now working. I did #rm -rf .gnome2/gedit/plugins, then recreated the plugins dir and reinstalled the plugin. It seems to work now. Thanks.
Is there a way to have it display the current document without first having to save it?
Anonymous # 5. January 2009, 20:58
Hi
useful plugin but please add Epiphany!
It might uses Webkit just like Firefox but I actually prefer this browser on my netbook.
Anonymous # 12. June 2009, 20:43
Broken download links?
Anonymous # 22. July 2009, 10:13
It's straightforward to modify the browser.py file to launch a specific Webkit browser. The defaults are Midori and Kfmclient, which I had never heard of before today. ;-)
Open browser.py (in the gedit plugins directory) and go to line 173. It should start with 'command = "midori " ...'.
Replace the single word 'midori' with the command to start your preferred browser. (For Debian, I use 'epiphany-webkit', which has to be installed, of course.)
Be careful not to change anything else, especially the indenting of the file and the single space after the browser command. Save the modified file with the same name.
It's necessary to restart gedit for changes to take effect.
Eckhard M. Jäger # 25. July 2009, 20:00
This is a dirty patch