Open Wilfred opened 11 years ago
If you run that code on your local machine (via the file:///
protocol), WhatFont cannot run (as you said). If you run that code on a web server (not via the file:///
protocol), WhatFont works fine.
The issue is not with WhatFont. The issue is that Chrome extensions (i.e. WhatFont) are not allowed to run in pages loaded via the file:///
protocol for security reasons. This is a JavaScript security feature to prevent malicious web pages from accessing your files.
Fixes #6
I'd really like this too. I know this likely wouldn't be possible on the bookmarklet, but seems like it could be on the Chrome extension. Take a look at how the Chrome extension Stylus is doing it maybe @chengyin? They have an option called "Allow access to file URLs" that does exactly this. :)
I did write a tweet referencing a JSFiddle, but I suspect that's just an iframe issue. My issue occurs without an iframe. With the following HTML:
And the following stylesheet:
I can't start whatfont, clicking the icon doesn't do anything.