views:

93

answers:

2

Hi,

I wrote a very simple extension for Safari 5 that only outputs a single log message from a start script. This is the start script:

console.log('start script running');

If I go to any internet page (eg. http://www.yahoo.com) the log message appears in the error console. But if I open any local html page no log message appears. By local I mean on my local machine. It's like my start script never gets run for local pages (eg. C:/blank.html).

Is there a permission setting I'm overlooking or is this a feature of Safari 5?

Brent

+2  A: 

Caveat: I only have a passing familiarity with the Safari extension system. I work on the Google Chrome system that Safari’s is based on, though.

In a Google Chrome extension, you can inject a script into a local page using the file:// permission. But I’m pretty sure there’s no analogue for Safari extensions.

The Safari page on script injection also seems to say you can’t interact with local files:

“You cannot access resources on the user’s hard drive outside of the extensions folder.”

byoogle
+2  A: 

There is no way to inject script on local files.

If you feel like it, you may complain at bugreport.apple.com.

zneak