Ticket #1356 (new enhancement)

Opened 10 months ago

Last modified 6 months ago

Enable more features, zero configuration for regression tests' Firefoxes

Reported by: Jani Laakso Owned by: Jani Laakso
Priority: undefined Milestone: Testing Tools Backlog
Component: Testing Tools Version:
Keywords: Cc:
Known Issue description:
Hours estimate: 5 Deadline (dd.mm.yyyy):
Known Issue version (since): Known Issue title:
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: yes Contract:

Description

Currently we got following issues

  • fileupload is not supported due to javascript security violation
  • default "vanilla" Firefox profile contains multiple checks that need to be manually configured
    • e.g. "This is not your default browser" modal question on startup
    • when doing first post "Are you sure you wish to post this data through unsecure HTTP"
    • etc..
  • we cannot close browser through javascript, now using kill (unix) or taskkill (windows) which is not robust
  • when browser has been abruptly closed we get a modal window "Restore existing session?" on startup

All above can be fixed by providing custom FF profile using user.js which defines false for all annoyances (security checks) and also provides us full access to browser by removing any security checks.

=> javascriptillä fileupload toimii => javascriptillä pystytään kirjoittamaan / lukemaan mikä tahansa tiedosto lokaalilta levylt‰ => javascriptillä pystytään sulkemaan Firefox (ei enää Windows:n taskkill ongelmia) => jos sessio räjähtää ei sitä yritetä koskaan recoveroida (tästä on jo bugi Trac:ssa) => päästään eroon monesta muustakin konfiguroinnista (checkDefaultBrowser, warnOnClose, warnSubmitInSecure jne..)

Olen kokeillut windows / mac Firefoxilla asentaa "custom" profiilin olemassaolevaan FF:ään ja tuntui toimivan. Fileuploadia en kokeillut mutta myös sen pitäisi toimia OK.

Työ koostuu installoinnin automatisoinnista, käytännössä ZIP pakettiin tuodaan profiili zipattuna ja tämä pitäisi purkaa oikeaan hakemistoon winkkarissa (jos käytössä custom hakemisto niin profiili pitää purkaa käsin).

Change History

Changed 10 months ago by Jani Laakso

How to do this:

1. create custom profile, e.g. itmill-testingtools

2. make modifications under Firefox/Profiles/juzm2wqv.itmill-testingtools

3. package profile to TT.zip

  • extracts to windows "default folder" under local settings folder

overwrite
C:\Documents and Settings\user\Application Data\Mozilla\Firefox\profiles.ini
{{{
[General]
StartWithLastProfile=1

[Profile1]
Name=itmill-testingtools
IsRelative=1
Path=Profiles/7loixs1o.itmill-testingtools
Default=1
}}}

unzip firefox-profile.zip into
C:\Documents and Settings\user\Application Data\Mozilla\Firefox\Profiles\

Check these pages:

http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries

http://www.mozilla.org/unix/customizing.html

  • see "Other Useful Preferences"

http://kb.mozillazine.org/Browser.sessionstore.resume_from_crash

http://www.mozilla.org/projects/security/components/signed-scripts.html

How to read / write local files using javascript in Mozilla http://www.captain.at/programming/xul/

Changed 10 months ago by Jani Laakso

  • type changed from defect to enhancement

Changed 10 months ago by Jani Laakso

Add something like this to user.js

//
// user.js: Personal prefs which mozilla shouldn't overwrite.
//


user_pref("dom.allow_scripts_to_close_windows", true);

user_pref("browser.tabs.warnOnClose", false);
user_pref("browser.tabs.warnOnCloseOther", false);
user_pref("browser.shell.checkDefaultBrowser", false);
user_pref("startup.homepage_welcome_url", "");
user_pref("startup.homepage_override_url", "");
user_pref("browser.startup.homepage", 0);
user_pref("browser.xul.error_pages.enabled", false);
user_pref("security.checkloaduri", false);
user_pref("security.warn_entering_secure.show_once", false);
user_pref("security.warn_entering_secure", false);
user_pref("security.warn_entering_weak", false);
user_pref("security.warn_entering_weak.show_once", false);
user_pref("security.warn_leaving_secure", false);
user_pref("security.warn_leaving_secure.show_once", false);
user_pref("security.warn_submit_insecure", false);
user_pref("security.warn_submit_insecure.show_once", false);
user_pref("security.warn_viewing_mixed", false);
user_pref("security.warn_viewing_mixed.show_once", false);
user_pref("update_notifications.enabled", false);


user_pref("browser.shell.checkDefaultBrowser", false);
//
// never restore previous sessions
//
user_pref("browser.startup.page", 0);
user_pref("browser.sessionstore.resume_from_crash", false);


user_pref("security.xpconnect.plugin.unrestricted", true);
user_pref("capability.policy.default.Window.print", "allAccess");

//
// Unlimited access for javascript
//
user_pref("capability.principal.codebase.p0.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalFileRead UniversalBrowserRead CapabilityPreferencesAccess");
user_pref("capability.principal.codebase.p0.id", "*");
user_pref("capability.principal.codebase.p0.subjectName", "");

Changed 9 months ago by Joonas Lehtinen

  • milestone set to Testing Tools 2

Changed 9 months ago by Jani Laakso

Marc has checked Embedded Firefox which might be the easiest solution here..

Changed 9 months ago by Jani Laakso

See also this, in case we would like to bundle firefox inside our package. http://www.mozilla.org/MPL/mpl-faq.html

Changed 6 months ago by Joonas Lehtinen

  • milestone changed from Testing Tools 2.0.0 to Testing Tools Backlog

Milestone Testing Tools 2.0.0 deleted

Note: See TracTickets for help on using tickets.