Bug 22452

Summary: Unchecking "Enable plugins" does not have any effect on navigator.plugins
Product: WebKit Reporter: Simo Kinnunen <sorccu>
Component: Plug-insAssignee: Ariya Hidayat <ariya.hidayat>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, ariya.hidayat, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch to fix the problem
none
patch to fix the problem
none
updated patch, changelog aroben: review+

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.