Enable Flash Player plugin in Safari with script

aaron_kelley
Contributor

I've seen a few discussions in the past on this, but never found an actual script that works.
We have recently put the latest update for Flash player in Self Service. The problem we're seeing is that on some Macs, the plugin will be turned on (checked) in Safari under the plugin-settings, and sometimes it won't be. I'm thinking that if I can have a script run after the installation of Flash Player to enable the plugin, then that will prevent the hassle of trying to explain to Teachers and Students how to enable it through preferences.
Help please?

1 ACCEPTED SOLUTION

chrischichester
New Contributor II

I will second the use of a configuration profile. I deleted the com.apple.Safari.plist from a computer with Safari 10, Relaunched it and configured all the plugins to on for all sites, which is what we had set for Safari 9. Then I edit the .plist and stripped out all the bits un-related to the plugins. I found that in addition to the <Key>ManagedPlugInPolicies</Key>, I still needed the <key>PluginInfo</key> for each plugin, though I could delete everything except <key>plugInCurrentState</key> <true/>

So for the several plugins we wanted to have enabled, I have this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ManagedPlugInPolicies</key>
    <dict>
        <key>com.Google.GoogleEarthPlugin.plugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.adobe.acrobat.pdfviewerNPAPI</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.adobe.director.shockwave.pluginshim</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.macromedia.Flash Player.plugin</key>
        <dict>
            <key>PlugInDisallowPromptBeforeUseDialog</key>
            <true/>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.microsoft.SilverlightPlugin</key>
        <dict>
            <key>PlugInDisallowPromptBeforeUseDialog</key>
            <true/>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.microsoft.sharepoint.browserplugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.oracle.java.JavaAppletPlugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
    </dict>
    <key>PlugInInfo</key>
    <dict>
        <key>com.Google.GoogleEarthPlugin.plugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.adobe.acrobat.pdfviewerNPAPI</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.adobe.director.shockwave.pluginshim</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.macromedia.Flash Player.plugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.microsoft.SilverlightPlugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.microsoft.sharepoint.browserplugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.oracle.java.JavaAppletPlugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
    </dict>
</dict>
</plist>

Initial testing is showing this working. I've had some complaints since Safari 10 of "This site says I don't have flash/java installed" Which seems to be how some of the pages react when the plugins are not enabled. I am hoping this configuration profile can solve this.

View solution in original post

11 REPLIES 11

rqomsiya
Contributor III

Hi @aaron.kelley ,

Look at this post:
https://www.jamf.com/jamf-nation/discussions/14624/safari-s-trusted-internet-plug-ins-possible-to-set-w-casper#responseChild92598

Might profile some insight.

aaron_kelley
Contributor

@rqomsiya I saw that earlier but I can't get those to work...maybe it is the layout of the way the user commented the scripts. I've tried different ways of typing them and nothing.

Gonzalez
New Contributor III

Have you tried a configuration profile with a custom payload? In our company it allows us to only open up sites we manage. Everything else is up to the employee. com.apple.Safari.plist is the domain and below is an example.

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ManagedPlugInPolicies</key> <dict> <key>com.macromedia.Flash Player.plugin</key> <dict> <key>PlugInDisallowPromptBeforeUseDialog</key> <true/> <key>PlugInHostnamePolicies</key> <array> <dict> <key>PlugInHostname</key> <string>Your URL Name</string> <key>PlugInIsFreshlyExpired</key> <false/> <key>PlugInLastVisitedDate</key> <date>2016-07-21T23:17:07Z</date> <key>PlugInPageURL</key> <string>https://Your URL Name/</string> <key>PlugInPolicy</key> <string>PlugInPolicyAllowWithSecurityRestrictions</string> <key>PlugInRunUnsandboxed</key> <true/> </dict> </array> </dict> </dict> </dict> </plist>

rqomsiya
Contributor III

Hi @aaron.kelley ,

Look at this post:
https://www.jamf.com/jamf-nation/discussions/14624/safari-s-trusted-internet-plug-ins-possible-to-set-w-casper#responseChild92598

Might provide some insight.

aaron_kelley
Contributor

@rqomsiya you already commented that...

chrischichester
New Contributor II

I will second the use of a configuration profile. I deleted the com.apple.Safari.plist from a computer with Safari 10, Relaunched it and configured all the plugins to on for all sites, which is what we had set for Safari 9. Then I edit the .plist and stripped out all the bits un-related to the plugins. I found that in addition to the <Key>ManagedPlugInPolicies</Key>, I still needed the <key>PluginInfo</key> for each plugin, though I could delete everything except <key>plugInCurrentState</key> <true/>

So for the several plugins we wanted to have enabled, I have this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ManagedPlugInPolicies</key>
    <dict>
        <key>com.Google.GoogleEarthPlugin.plugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.adobe.acrobat.pdfviewerNPAPI</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.adobe.director.shockwave.pluginshim</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.macromedia.Flash Player.plugin</key>
        <dict>
            <key>PlugInDisallowPromptBeforeUseDialog</key>
            <true/>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.microsoft.SilverlightPlugin</key>
        <dict>
            <key>PlugInDisallowPromptBeforeUseDialog</key>
            <true/>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.microsoft.sharepoint.browserplugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
        <key>com.oracle.java.JavaAppletPlugin</key>
        <dict>
            <key>PlugInFirstVisitPolicy</key>
            <string>PlugInPolicyAllowWithSecurityRestrictions</string>
        </dict>
    </dict>
    <key>PlugInInfo</key>
    <dict>
        <key>com.Google.GoogleEarthPlugin.plugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.adobe.acrobat.pdfviewerNPAPI</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.adobe.director.shockwave.pluginshim</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.macromedia.Flash Player.plugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.microsoft.SilverlightPlugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.microsoft.sharepoint.browserplugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
        <key>com.oracle.java.JavaAppletPlugin</key>
        <dict>
            <key>plugInCurrentState</key>
            <true/>
        </dict>
    </dict>
</dict>
</plist>

Initial testing is showing this working. I've had some complaints since Safari 10 of "This site says I don't have flash/java installed" Which seems to be how some of the pages react when the plugins are not enabled. I am hoping this configuration profile can solve this.

Malcolm
Contributor II

@chrischichester Hey, do you know if this still works in safari 12?

and what path are you applying the .plist to?

McGinn
Contributor

I am also trying to see if this works in safari 12...I will try and post back here if I find anything.

praveenbc76
New Contributor

@McGinn Is it working for safari 12?

CSCC-JS
Contributor III

Apple removed NPAPI plugin support in Safari 12, which Adobe Flash was.
However... https://developer.apple.com/documentation/safari_release_notes/safari_12_release_notes
Indicate Flash is still supported?

Malcolm
Contributor II

@chrischichester it appears with safari 12, they had changed the location of the plist file, but it appears, the above does not work with it.
Have you happened to of been able to make it work? I would love to be able to whitelist a number of educational sites that use flash.