Reputation: 51
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 (e.g. 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 (e.g. C:/blank.html).
Is there a permission setting I'm overlooking or is this a feature of Safari 5?
Upvotes: 5
Views: 1059
Reputation: 138031
There is no way to inject scripts on local files.
If you feel like it, you may complain at bugreport.apple.com.
Upvotes: 3
Reputation: 2994
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.”
Upvotes: 3