Chrome browser - Adding URL to allow flash plugin

Johnny_Kim
Contributor II

I'm trying to add an URL to allow flash player plugin to work as one of the testing site relies on it. I've tried scripting this and does write it in the plist but doesn't reflect on chrome. I did see the configuration profile method but rather not use that as I've seen inconsistency in the past.

Any help would be appreciated!

#!/bin/sh

#  iReady_URL_Chrome.sh
#  
#
#  Created by jkim on 5/2/17.
#

LIU=`ls -l /dev/console | cut -d " " -f 4`

sudo defaults write /Users/$LIU/Library/Preferences/com.google.Chrome.plist PluginsAllowedForUrls ""[*.]i-ready.com""
1 ACCEPTED SOLUTION

CAJensen01
Contributor

I would suggest the configuration profile route. I've had good success with this.

Custom Settings, Pref Domain:
com.google.Chrome

{PluginsAllowedForUrls=[https://example1.com, https://example2.com]}

How this actually looks in the .plist you're uploading:

<?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>PluginsAllowedForUrls</key>
    <array>
        <string>https://example1.com</string>
        <string>https://example2.com</string>
    </array>
</dict>
</plist>

View solution in original post

7 REPLIES 7

prbsparx
Contributor II

PluginsAllowedForUrls is an array, not a string, so you need to set it to:

sudo defaults write /Users/$LIU/Library/Preferences/com.google.Chrome.plist PluginsAllowedForUrls '("[*.]i-ready.com")'

To add multiple web urls:

sudo defaults write /Users/$LIU/Library/Preferences/com.google.Chrome.plist PluginsAllowedForUrls '("[*.]i-ready.com", "[*.]example.com")'

Johnny_Kim
Contributor II

@prbsparx Good catch but I tried it and still didn't work. Doesn't show the site as one of the allowed.

sapalmerBCS
New Contributor III

@Johnny.Kim Did you have any luck? I've just found that one of our textbook sites doesn't prompt that it needs to use Flash in the newest version of Chrome so I'm trying to find a way to push the change out to all students so they don't have to add the site manually to the allowed list.

P.S. Textbook websites are the worst.

CAJensen01
Contributor

I would suggest the configuration profile route. I've had good success with this.

Custom Settings, Pref Domain:
com.google.Chrome

{PluginsAllowedForUrls=[https://example1.com, https://example2.com]}

How this actually looks in the .plist you're uploading:

<?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>PluginsAllowedForUrls</key>
    <array>
        <string>https://example1.com</string>
        <string>https://example2.com</string>
    </array>
</dict>
</plist>

Johnny_Kim
Contributor II

@CAJensen01 Thanks!! That worked.

jmahlman
Valued Contributor

I wonder if this would work with wildcards...

prbsparx
Contributor II

Yes, wild cards work to a limit, it only works at the beginning:
Example:
[*.]example.com

You can see the detailed version in my earlier comment. It works in defaults, Managed Preferences, and profiles.