Bug 22452 - Unchecking "Enable plugins" does not have any effect on navigator.plugins
Summary: Unchecking "Enable plugins" does not have any effect on navigator.plugins
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Ariya Hidayat
URL:
Keywords: InRadar
: 23329 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-24 04:52 PST by Simo Kinnunen
Modified: 2009-01-16 07:17 PST (History)
3 users (show)

See Also:


Attachments
Patch to fix the problem (415 bytes, patch)
2009-01-15 08:47 PST, Ariya Hidayat
no flags Details | Formatted Diff | Diff
patch to fix the problem (1.71 KB, patch)
2009-01-16 05:11 PST, Ariya Hidayat
no flags Details | Formatted Diff | Diff
updated patch, changelog (5.44 KB, patch)
2009-01-16 06:42 PST, Ariya Hidayat
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simo Kinnunen 2008-11-24 04:52:29 PST
Unlike in Firefox and Opera, a plugin's entry in navigator.plugins and its corresponding mimetype entries in navigator.mimeTypes are set even if plugins are disabled. Internet Explorer is of no concern because of its ActiveX plugin architecture; the aforementioned collections are always empty.

Firefox (3.1b1), Flash enabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> Plugin
navigator.mimeTypes['application/x-shockwave-flash'] -> MimeType
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> Plugin

Firefox (3.1b1), Flash disabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> undefined
navigator.mimeTypes['application/x-shockwave-flash'] -> undefined
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> throws TypeError

Opera (9.62), Flash enabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> Plugin
navigator.mimeTypes['application/x-shockwave-flash'] -> MimeType
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> Plugin

Opera (9.62), Flash disabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> undefined
navigator.mimeTypes['application/x-shockwave-flash'] -> undefined
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> throws TypeError

WebKit r38699, Flash enabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> Plugin
navigator.mimeTypes['application/x-shockwave-flash'] -> MimeType
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> Plugin

INCONSISTENT: WebKit r38699, Flash disabled:
---------------------------------------
navigator.plugins['Shockwave Flash'] -> Plugin
navigator.mimeTypes['application/x-shockwave-flash'] -> MimeType
navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin -> null
Comment 1 Mark Rowe (bdash) 2008-11-24 04:53:23 PST
<rdar://problem/6396442>
Comment 2 Ariya Hidayat 2009-01-15 08:37:59 PST
*** Bug 23329 has been marked as a duplicate of this bug. ***
Comment 3 Ariya Hidayat 2009-01-15 08:47:32 PST
Created attachment 26758 [details]
Patch to fix the problem

Do not return pluginData if plugins are disabled.
Comment 4 Ariya Hidayat 2009-01-16 05:11:17 PST
Created attachment 26790 [details]
patch to fix the problem

Updated patch, with entry to ChangeLog.
Comment 5 Ariya Hidayat 2009-01-16 06:42:13 PST
Created attachment 26792 [details]
updated patch, changelog

addressing Simon's comment: safeguard some places where pluginData() might return NULL.
Comment 6 Adam Roben (:aroben) 2009-01-16 07:07:34 PST
Comment on attachment 26792 [details]
updated patch, changelog

r=me
Comment 7 Ariya Hidayat 2009-01-16 07:17:57 PST
Landed in r39969.