RESOLVED FIXED 151783
Allow JavaScript to iterate over plugins for local files
https://bugs.webkit.org/show_bug.cgi?id=151783
Summary Allow JavaScript to iterate over plugins for local files
Brent Fulgham
Reported 2015-12-02 17:34:21 PST
In Bug 149014 we hid all plugins (except Flash, Java, and QuickTime) so that sites could not inspect the user configuration looking for fingerprinting entropy. However, there are some cases where we would like to allow this information to be accessed by JavaScript, such as in Safari's "Help | Installed Plug-ins" page. Therefore, allow documents loaded from the local file system to iterate over all plugins via JavaScript.
Attachments
Patch (9.03 KB, patch)
2015-12-02 17:39 PST, Brent Fulgham
ap: review+
Brent Fulgham
Comment 1 2015-12-02 17:39:24 PST
Simon Fraser (smfr)
Comment 2 2015-12-02 17:40:30 PST
Comment on attachment 266489 [details] Patch Wouldn't it be safer to have Safari call some SPI on a WKWebView that allows it to enumerate all plug-ins?
Brent Fulgham
Comment 3 2015-12-02 17:40:53 PST
Brent Fulgham
Comment 4 2015-12-02 17:41:48 PST
(In reply to comment #2) > Comment on attachment 266489 [details] > Patch > > Wouldn't it be safer to have Safari call some SPI on a WKWebView that allows > it to enumerate all plug-ins? That was my original proposal, but after discussion with Anders and Alexey it was decided that the "local file" test is sufficient.
Said Abou-Hallawa
Comment 5 2015-12-02 18:35:15 PST
Comment on attachment 266489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266489&action=review > LayoutTests/http/tests/plugins/plugin-javascript-access.html:16 > + else I think there is no need for else here. > LayoutTests/http/tests/plugins/plugin-javascript-access.html:34 > + } I think the style guidelines (for C++ at least) state that there is no need for braces for single line blocks. > LayoutTests/http/tests/plugins/plugin-javascript-access.html:79 > + document.writeln("<p>FAILURE! (Failed to find netscape test plugin)<\/p>"); Why do we have two different messages for not finding the netscape test pulgin: 1. (Could not find the netscape test plugin on a non-local file!) 2. (Failed to find netscape test plugin) Also can't we move writing the pass/failure messages to checkForTestPlugin()? You may need to pass a parameter like shouldFindTestPlugin and it's equal to foundTestPlugin, then you write PASS otherwise you write FAILURE.
Brent Fulgham
Comment 6 2015-12-03 11:28:20 PST
Comment on attachment 266489 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266489&action=review >> LayoutTests/http/tests/plugins/plugin-javascript-access.html:16 >> + else > > I think there is no need for else here. it's how the 'found" state is reached. However, I restructured things so that we don't need the 'foundTestPlugin' variable or the else. >> LayoutTests/http/tests/plugins/plugin-javascript-access.html:34 >> + } > > I think the style guidelines (for C++ at least) state that there is no need for braces for single line blocks. Sure. I'll change that. >> LayoutTests/http/tests/plugins/plugin-javascript-access.html:79 >> + document.writeln("<p>FAILURE! (Failed to find netscape test plugin)<\/p>"); > > Why do we have two different messages for not finding the netscape test pulgin: > 1. (Could not find the netscape test plugin on a non-local file!) > 2. (Failed to find netscape test plugin) > > Also can't we move writing the pass/failure messages to checkForTestPlugin()? You may need to pass a parameter like shouldFindTestPlugin and it's equal to foundTestPlugin, then you write PASS otherwise you write FAILURE. I revised the messages so they have the same phrasing, but left the two cases. However, I don't really want the function to be responsible for the pass/fail state (or the message), since in the first part of the test finding the plugin has a different meaning than after we turn on the debugging feature.
Brent Fulgham
Comment 7 2015-12-03 12:06:30 PST
Darin Adler
Comment 8 2015-12-07 10:51:02 PST
I’d really prefer that this security check be done with SecurityOrigin function rather than a direct call to isLocalFile.
Brent Fulgham
Comment 9 2015-12-21 12:43:49 PST
(In reply to comment #8) > I’d really prefer that this security check be done with SecurityOrigin > function rather than a direct call to isLocalFile. Please see Bug 152489, where I make that correction.
Note You need to log in before you can comment on or make changes to this bug.