搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

How to allow my plugin on trusted sites (my sites) in firefoxProfile ?

  • 2 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

I have a plugin "4game" and i try to test a site which uses this plugin. How i can allow launching and using this plugin in firefox ? It looks like there https://support.mozilla.org/en-US/kb/how-allow-java-trusted-sites

But i have to do it in my tests (webdriver) I tried to specify

               firefoxProfile.setPreference("plugins.click_to_play", true);
               firefoxProfile.setPreference("plugin.state.flash", 0);
               firefoxProfile.setPreference("plugin.state.4game", 2);

But it doesn't work for me

I have a plugin "4game" and i try to test a site which uses this plugin. How i can allow launching and using this plugin in firefox ? It looks like there https://support.mozilla.org/en-US/kb/how-allow-java-trusted-sites But i have to do it in my tests (webdriver) I tried to specify firefoxProfile.setPreference("plugins.click_to_play", true); firefoxProfile.setPreference("plugin.state.flash", 0); firefoxProfile.setPreference("plugin.state.4game", 2); But it doesn't work for me

被選擇的解決方法

Are you saying that you need to do this in a fresh profile created just for the test?

If you can re-use an existing profile:

The easiest way is to watch for the plugin notification on the address bar (looks like a Lego block), click that, and use "Allow and Remember".

The next easiest way is to use the Page Info dialog's Permissions panel. When on the site hosting the content, you can open that using either:

  • right-click and choose View Page Info
  • (menu bar) Tools > Page Info
  • click the padlock or globe in the address bar > More Information

On the Permissions panel, you can "Allow" a specific plugin for the site.

Do any of those work for you?

If you cannot re-use an existing profile:

I doubt you will be able to do a site-specific exception, but yes, setting the plugin.state.identifier preference to 2 should allow all sites.

I don't know what the identifier is. Have you checked a running instance of Firefox to see whether it is simply 4game or it's another string?

從原來的回覆中察看解決方案 👍 0

所有回覆 (2)

more options

選擇的解決方法

Are you saying that you need to do this in a fresh profile created just for the test?

If you can re-use an existing profile:

The easiest way is to watch for the plugin notification on the address bar (looks like a Lego block), click that, and use "Allow and Remember".

The next easiest way is to use the Page Info dialog's Permissions panel. When on the site hosting the content, you can open that using either:

  • right-click and choose View Page Info
  • (menu bar) Tools > Page Info
  • click the padlock or globe in the address bar > More Information

On the Permissions panel, you can "Allow" a specific plugin for the site.

Do any of those work for you?

If you cannot re-use an existing profile:

I doubt you will be able to do a site-specific exception, but yes, setting the plugin.state.identifier preference to 2 should allow all sites.

I don't know what the identifier is. Have you checked a running instance of Firefox to see whether it is simply 4game or it's another string?

more options

You can use a mozilla.cfg file in the Firefox program folder to specify new (default) values or to lock prefs.

Place a local-settings.js file in the defaults\pref folder where also the channel-prefs.js file is located to specify using mozilla.cfg.

pref("general.config.filename", "mozilla.cfg");

These functions can be used in the mozilla.cfg file:

defaultPref();	// set new default value
pref();		// set pref, but allow changes in current session
lockPref();	// lock pref, disallow changes

See: