4

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 Answers2

3

Caveat: I only have a passing familiarity with the Safari extension system. I work on Google Chrome which is based on Webkit. Safari is also based on webkit.

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.”

Community
  • 1
  • 1
oldestlivingboy
  • 2,914
  • 2
  • 21
  • 15
3

There is no way to inject scripts on local files.

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

zneak
  • 134,922
  • 42
  • 253
  • 328