Enable Javascript for local .html files

James Richard Tyrer tyrerj at acm.org
Mon Dec 1 12:12:31 GMT 2008


Dave Feustel wrote:
> On Fri, Nov 28, 2008 at 05:26:09PM -0700, James Richard Tyrer wrote:
>> Dave Feustel wrote:
>>> How do I enable Javascript in Konqueror for all local .html 
>>> files? I'd rather not enable Javascript globally because I tend 
>>> to forget to reset the flag and then I get into trouble on the 
>>> net.
>>> 
>> This appears to be a help request which wouldn't be appropriate for
>>  this list.  However, if this isn't currently simple enough, it 
>> might be a feature that needs to be added.
>> 
>> Your computer has a host name which defaults to "localhost" if you 
>> haven't given it a name.  So, add the host name of your computer to
>> the Domain Specific window in the JavaScript tab just like you 
>> would for any other host or domain.  If that works, I don't see a 
>> development issue.
>> 
>> Did that work for your?
> 
> I have added localhost to the Javascript enable list. I will also try
>  adding 127.0.0.1.

That is the loop back IP address.  IIUC, the IP address for your system
is defined as 127.0.0.0.  I don't know if you can use an IP address
there.  It says Host/Domain. but the IP address might be acceptable.

The Help file isn't much help here.  It says:

> The checkboxes under Global Settings allow you to turn JavaScript
> support on for all web sites by default. You can also select to turn
> JavaScript on or off for specific hosts. To add a policy for a
> specific host, click the Add... button to bring up a dialog in which
> you can type the host name and then choose to accept or reject
> JavaScript code from that particular host, which will add the domain
> to the list on the left of the page.

Not very helpful, and clearly it there is an error since it confuses 
'host' and domain.  Should a bug report be filed for this?

I also wonder about:

	Host/Domain

This is possibly confusing since it is actually:

	Host.Domain

So, what I don't know and the empty documentation doesn't say is 
whether: "localhost" is sufficient or if "localhost.localdomain" is 
necessary and whether the local IP address (127.0.0.0) would also work. 
  I presume that an IP address should work since not all websites have a 
Host.Domain URL.

So, if you have:

	localhost		Accept

does it work, and are you sure that you didn't name your system
something else?  Some distros encourage you to name your system --
something that I don't think is a good idea (some things appear to 
presume that your system is "localhost.localdomain" even if you try to 
name it something else).

Look for a file named:

	/etc/hostname
	/etc/HOSTNAME

and see what it says.  If there is something other than "localhost" in 
the file then you need to use that.

Then you could try:

	localhost.localdomain	Accept

{or substitute your HostMame for "localhost" if it is different}

> I got this to work a while ago but I have forgotten just what I did. 
> I'm actually now working with SVG which has the ability to interact 
> with Javascript. Firefox seems to work marginally better with SVG, 
> but I really prefer Konqueror to any other browser. How much code 
> does konqueror comprise? Is it reasonable for me as a single 
> individual to hack on konqueror?
> 
There is a lot of code for Konqueror, but it is modular.  The JavaScript
code is actually in "kdelibs/khtml/ecma/.  ECMA Script is the correct
name for JavaScript.  I don't know exactly where the JavaScript policy 
is controlled.

-- 
JRT





More information about the kfm-devel mailing list