https://wiki.mozilla.org/api.php?action=feedcontributions&user=Anaaktgeboren&feedformat=atomMozillaWiki - User contributions [en]2024-03-29T13:52:54ZUser contributionsMediaWiki 1.27.4https://wiki.mozilla.org/index.php?title=Girl_Geek_Dinner_2013&diff=768779Girl Geek Dinner 20132013-11-22T23:51:26Z<p>Anaaktgeboren: /* Demos */</p>
<hr />
<div>= Details =<br />
<br />
Where: [[SF|Mozilla SF]] Space 2 Harrison Ave, Suite 175 (entry off Embarcadero, corner of Harrison)<br />
<br />
When: '''Thursday December 5, 2013 -- 6pm - 9pm'''<br />
<br />
Evening Details:<br />
* Demos 6-9pm in the back room of the public space<br />
* Speaking from 7-8pm ~10 mins per speaker<br />
* Recruiting table near the front to greet attendees, hand out socks<br />
<br />
= Speakers =<br />
<br />
This is already firm, so if you're interested in speaking and aren't on this list please check with Lukas<br />
<br />
* Lukas (intro, talk about Dec 6th)<br />
* Liz Henry<br />
* Larissa Co<br />
* Margaret Leibovic<br />
* Mary Colvig<br />
* Mitchell Baker<br />
* Michelle Marovich<br />
* Didem Ersoz (lightning talk re: WebFWD)<br />
<br />
= Demos =<br />
* Ilana Segall (anything you're able to talk about)<br />
* Margaret Leibovic (Mobile)<br />
* Yuan Wang, Allison Naaktgeboren (Firefox Metro)<br />
* Liz Henry (bug wrangling - contributing to Mozilla)<br />
* Boriss (webrtc/Talkilla)<br />
* Jen Bertsch (Mozilla.org Homepage redesign)<br />
* Emily Goligoski (Open Badges, BadgeKit)<br />
<br />
= Recruiting & Intern Program =<br />
* Kimber Schlegelmilch<br />
* Michelle Marovich<br />
* Jill Alvarez<br />
<br />
= Representing & Hosting = <br />
* Laura Forrest (won't be there until 7pm)<br />
* Mary Trombley<br />
* Larissa Shapiro<br />
* Kate Naszradi<br />
<br />
*<br />
<br />
= Logistics =<br />
== Done ==<br />
* ServiceNow request for food<br />
* Space booked<br />
* Socks ordered and should arrive on 11/27<br />
* Service Desk request for IT support<br />
* Air Mozilla request for speakers<br />
* Email sent to Rainer & Spencer for additional videos & photos<br />
* Decorations ordered<br />
* Name tags<br />
* Demos: who needs what & setup planning in the space<br />
* Speakers - get slides early<br />
* Send GGD careers listings & post the lottery</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/WindowsDevEnvTips&diff=754010Firefox/WindowsDevEnvTips2013-11-06T23:16:14Z<p>Anaaktgeboren: </p>
<hr />
<div>== Intro ==<br />
* Developing & building Gecko& friends on Windows, especially Windows 8, has lots of room for improvement. Here's some of the tribal knowledge to make you happier on our most popular platform.<br />
== Customizations to the Console Emulator ==<br />
== Build System Tweaks ==<br />
== Handy MOZCONFIG settings ==<br />
== Nifty Visual Studio tricks ==<br />
=== VS 2010-13 ===<br />
=== VS 2010 ===<br />
=== VS 2011 === <br />
=== VS 2012 ===<br />
== Debugging JS on Windows ==<br />
== Debugging CPP on Windows ==<br />
== Want to help improve the build system on Windows? ==<br />
* visit #build and chat with :gps</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/WindowsDevEnvTips&diff=753972Firefox/WindowsDevEnvTips2013-11-06T23:03:04Z<p>Anaaktgeboren: Created page with "test"</p>
<hr />
<div>test</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Outreachy/2014/December_to_March&diff=752313Outreachy/2014/December to March2013-11-06T00:27:47Z<p>Anaaktgeboren: </p>
<hr />
<div>=Outreach Program For Women 2013=<br />
This page contains all the information about the opportunity with Mozilla for the Outreach Program for Women internship that will take place from '''December 10, 2013-March 10, 2014'''. Please see the [https://live.gnome.org/OutreachProgramForWomen main program page] for the general information about the program, such as timeline, background information, eligibility, requirements, and the application form.<br />
<br />
We have several mentors this year for our third time participating as a project, and not just a sponsor, in this valuable program.<br />
<br />
==Requirements==<br />
<br />
=== Rust and Servo ===<br />
<br />
Successful candidates for either Rust or Servo will need some previous programming experience. Code will be written primarily in Rust, but previous experience with Rust is not a requirement. Successful candidates will have at least beginner-level proficiency programming in C, as well as some exposure to systems programming (such as having taken an operating systems class in college or having equivalent familiarity from self-study). If you aren't sure whether you have the background we expect, please [https://mozillians.org/en-US/u/tjc/ contact Tim] as soon as possible. We'll be happy to talk with you about your background and interests.<br />
<br />
OPW interns are expected to spend at least 40 hours a week on their projects. Thus, we cannot accept interns who have another job that will take more than 20 hours a week, ''or'' who are taking classes more than half-time. Moreover, interns who have other time commitments will be held to a higher standard in the application process. We think that interns who are able to devote most of their time to the internship will get the most out of it.<br />
<br />
=== Community building ===<br />
<br />
Successful candidates for the community building project will have some previous open source community experience. Familiarity with open source communication tools such as IRC, MediaWiki, and Bugzilla will be extremely helpful. <br />
<br />
The ideal candidate will be: <br />
* Enthusiastic about media & open source, with a love for the Web, Mozilla & Firefox<br />
* Will possess exceptional communication & organizational skills<br />
* Has a positive attitude, striving for quality with attention to detail, and willingness to learn<br />
* Is a self-driven team-player, able to multi-task effectively in a fast-paced environment<br />
* Must embrace an environment that is highly transparent and collaborative, with a highly diverse demographic and culture<br />
<br />
==Project 1: Rust==<br />
Mentor: [https://mozillians.org/en-US/u/tjc/ Tim Chevalier] (and possibly other mentors to be determined)<br />
<br />
===Background on Rust===<br />
<br />
Rust is a statically typed programming language that emphasizes high performance, memory safety, and concurrency. Mozilla is stewarding the development of a compiler, tools, and standard libraries for Rust, all of which are open-source. The Rust community consists of a small number of Mozilla staff engineers in addition to a large and vibrant community of volunteers. The Rust community has a [https://github.com/mozilla/rust/wiki/Note-development-policy code of conduct] to encourage inclusion and openness.<br />
<br />
* [http://rust-lang.org/ Home page]<br />
* [http://static.rust-lang.org/doc/master/tutorial.html Tutorial]<br />
* [https://github.com/mozilla/rust/wiki Rust wiki] on github<br />
<br />
===Specific project ideas===<br />
<br />
The following are suggested projects related to Rust. We encourage you to discuss the projects with members of the Rust team (Tim - tjc on IRC - can suggest which person knows the most about a particular project), either on IRC or by [https://mozillians.org/en-US/u/tjc/ emailing Tim directly]. We are also open to suggestions if you have a particular project in mind (for guidance, look at the [https://github.com/mozilla/rust/issues Rust issue tracker] and the [https://github.com/mozilla/rust/issues?labels=A-an-interesting-project&state=open issues tagged as interesting projects]).<br />
<br />
====Project A: Benchmarking for Rust:====<br />
<br />
https://github.com/mozilla/rust/issues/7532<br />
<br />
Rust currently lacks benchmarks that are clearly focused on a single part of Rust's libraries or<br />
code generator. Writing benchmarks -- small programs designed to test the performance (primarily<br />
use of time and memory) of one component of the Rust toolchain -- is important for improving<br />
the performance of the code that the Rust compiler generates.<br />
<br />
Rust already has a built-in benchmark runner, making this task easier to get started with.<br />
These benchmarks are intended to measure how Rust's performance changes over time -- they are<br />
not intended for comparing Rust to other programming languages.<br />
<br />
An interested person could write benchmarks that measure any or all of the following: memory<br />
allocation with destructors, memory allocation in Rust's garbage-collected heap, pattern<br />
matching, numerics, data structures, string manipulation, methods, trait objects (dynamic<br />
dispatch).<br />
<br />
====Project B: Parallel profiling====<br />
<br />
https://github.com/mozilla/rust/issues/7233<br />
<br />
One of Rust's design goals is to support parallel and concurrent programming that's simple<br />
and easy to reason about. One of the main reasons to write parallel code is performance:<br />
on the surface, it makes no sense to let available resources sit idle while unfinished work<br />
remains that they could be doing. But in practice, parallelism also comes with overhead,<br />
and it can also be hard to predict whether code that ''should'' run in parallel actually does.<br />
<br />
Designing and implementing a profiler to assist in writing efficient parallel Rust code is a<br />
broad task, but in the near term, a step along the way would be to support "watching" particular<br />
tasks, and printing out when those tasks were active and what threads they were active on. This<br />
raw data could be processed by another tool to help the user understand how parallel the<br />
code actually was.<br />
<br />
====Project C: Randomized testing for Rust====<br />
<br />
https://github.com/mozilla/rust/issues/7232<br />
<br />
QuickCheck ( http://www.haskell.org/haskellwiki/Introduction_to_QuickCheck ) is a well-known<br />
library for Haskell that supports randomly generating many kinds of data structures for use in<br />
writing unit tests. (You don't have to have any familiarity with Haskell for this project, though<br />
it wouldn't hurt!) This approach has been ported to many other languages, and it would be very<br />
useful for Rust to become one of them.<br />
<br />
Some previous work on this has been done ( https://github.com/dbp/rust-quickcheck and<br />
https://github.com/blake2-ppc/qc.rs ), but work would need to happen to bring it up to the latest<br />
version of Rust and to make it production-ready. Completing this project could potentially improve<br />
the quality of test coverage for Rust's standard libraries.<br />
<br />
====Project D: Systematic testing of Rust concurrency primitives====<br />
<br />
https://github.com/mozilla/rust/issues/6957<br />
<br />
Rust has various low-level building blocks for concurrency, such as task spawning, scheduling, pipes,<br />
and automatically reference-counted data structures. There are various interesting approaches to<br />
testing concurrency libraries; one is to implement a system that systematically explores the state<br />
space of possible test executions (that is, combinations of choices that the task scheduler could make).<br />
This is an open-ended and research-level project. See the github issue for more details.<br />
<br />
====Project E: Disassembly and examination for compiled Rust libraries====<br />
<br />
https://github.com/mozilla/rust/issues/6912<br />
<br />
On Unix-like systems, the binutils tools (e.g. ar, nm) are well-known, and Mac OS has objdump<br />
as an equivalent. We would find it useful to have versions of these tools that are specialized<br />
to libraries that were known to be compiled from Rust. These tools would be useful for compiler<br />
implementors trying to improve the performance of generated code. The project would probably<br />
involve taking advantage of existing libraries that are part of LLVM.<br />
<br />
====Project F: An efficient B-tree library for Rust====<br />
<br />
https://github.com/mozilla/rust/issues/4992<br />
<br />
A B-tree is one kind of balanced binary tree. Some work has been done already on implementing<br />
a B-tree library for Rust, but the problem would involve making it production-ready, including<br />
writing unit tests and ideally, real benchmarks that use the B-tree.<br />
<br />
====Project G: Test coverage data====<br />
<br />
https://github.com/mozilla/rust/issues/690<br />
<br />
Code coverage tools like gcov are helpful in understanding how many possible code execution paths<br />
a given test suite actually exercised. Rust currently has no integration with gcov or any other<br />
coverage tools. The project would involve modifying the Rust compiler to add a flag that, if it's<br />
enabled, means the compiler would insert special code into generated executables to record coverage<br />
information. Rust's debug info facilities have been improved a lot in the past few months, making<br />
this project easier to approach.<br />
<br />
====Project H: Fuzz testing with fault injection====<br />
<br />
https://github.com/mozilla/rust/issues/2736<br />
<br />
Fuzz testing is the art of generating random input to find bugs in programs. The subtlety comes in<br />
when you try to generate the random inputs in a way that's distributed so as to find as many<br />
''different'' bugs as possible.<br />
<br />
Rust has a fuzz testing tool already, but it hasn't been maintained in quite some time and can't<br />
be used with modern Rust. The beginning of the project could involve resurrecting this tool and<br />
making it usable with Rust 0.9. Once that work was done, ideally the project would involve<br />
implementing fault injection in order to test how concurrency libraries handle task failure at<br />
arbitrary times.<br />
<br />
====Project I: Cross-language inlining====<br />
<br />
https://github.com/mozilla/rust/wiki/Mixed-language-link-time-optimization<br />
<br />
Rust supports interoperability with C (and potentially C++) using its foreign function interface (FFI). Inlining is an important compiler optimization that involves replacing a function call with a copy of the body of the function. Typically, compilers only inline within code that's written in the same language. Because Rust uses [http://llvm.org/ LLVM] as its back-end, it would be relatively straightforward to take advantage of some LLVM features to achieve inlining from code generated by the Rust compiler into C code, or vice versa. This is an example of ''link-time optimization''.<br />
<br />
LLVM implements much of what's needed already, so the project would consist of putting the pieces together, as well as writing relevant benchmarks and profiling the resulting code.<br />
<br />
==Project 2: Servo==<br />
Mentors: [https://mozillians.org/en-US/u/lbergstrom/ Lars Bergstrom] and [https://mozillians.org/en-US/u/metajack/ Jack Moffitt] (and possibly other mentors to be determined)<br />
<br />
Servo is a prototype Web browser engine currently being implemented in Rust by members of [http://mozilla.com/research Mozilla Research], as well as volunteers. One of the goals of Servo is to explore how Web browsers can take advantage of modern multi-core computers.<br />
<br />
===Specific project ideas===<br />
<br />
====Project J: Performance analysis against Firefox and Gecko====<br />
In Servo, we want to be able to compare the time it takes us to lay out and render a page against the Firefox engine, Gecko. To do that properly, we need to report the same events and timings in the same way. This project entails learning how to profile the display of web pages in Gecko, instrumenting Servo with similar reporting, and helping to generally build up the Servo performance infrastructure and benchmarking suite.<br />
<br />
====Project K: Multi-platform windowing system support====<br />
Currently Servo runs on Linux, OSX, and Android. We use both the new GLFW and old GLUT to access the windowing systems on these platforms, as GLFW does not yet fully support Android. This project would involve adding support to the GLFW project to target Android devices and integrate that support into the glfw-rs Rust bindings and ultimately Servo.<br />
<br />
====Project L: Fixed Positioning====<br />
<br />
We need support for the CSS `position: fixed` property which fixes<br />
elements relative to the viewport. This would entail created a new<br />
layer in the display list for the fixed elements, and then support in<br />
the compositor for placing the fixed layer in the viewport always as<br />
the other layers scroll.<br />
<br />
====Project M: Graphical Overlays for Debugging====<br />
<br />
It would be useful to have graphical overlay layers that showed<br />
debugging information. One example would be the current frames per<br />
second of the compositor. Another would be to demarcate tile<br />
boundaries. Yet another is to show how the flow tree relates to what<br />
is on screen. This would involve a little bit of graphics code to draw<br />
the overlay plus digging up useful information that we already have<br />
available and showing it.<br />
<br />
==Project 3: Community Building==<br />
Mentor: [https://mozillians.org/en-US/u/lshapiro/ Larissa Shapiro] (and possibly other mentors to be determined)<br />
<br />
Background: <br />
* [https://wiki.mozilla.org/Contribute/ Contribute Wiki ]<br />
<br />
===Details===<br />
Mozilla is a proudly non-profit organization dedicated to keeping the power of the Web in people’s hands. We’re a global community of users, contributors and developers working to innovate on your behalf. When you use Firefox, or any Mozilla product, you become a part of that community, helping us build a brighter future for the Web.<br />
<br />
The Community Building Coordinator will be an integral part of Mozilla's community building strategy in 2013 as we build out the capabilities to support local community building efforts in strategic regions around the world.<br />
<br />
Interns will gain experience working in a cross-functional team that touches all points of the organization and project. Interns will also gain experience with growing a world wide community of volunteers, creating scalable processes, and distributing knowledge in a decentralized and multilingual environment.<br />
<br />
Specific work may include but is not limited to:<br />
<br />
* Interviewing members of contributor communities<br />
* Coordinate among stakeholders to capture, create, and organize supporting material<br />
* Create a contribution funnel toolkit that may include documentation, templates, videos, design files, and other assets<br />
* Promotion of guide to relevant audiences<br />
* Research on contributor development strategies in other organizations<br />
<br />
== Project 4: Firefox for Metro ==<br />
Mentor: [https://mozillians.org/en-US/u/anaaktge/ Allison Naaktgeboren(Firefox Developer, :ally on irc)]<br />
* Firefox for Metro, the Windows 8 tablet UI, is the latest addition to the Firefox family and the first touch centric browser. Windows 8 is one of the fastest growing segments of the Firefox population.<br />
=== Project A: Development ===<br />
* Help us ship the 1.0 of Firefox for Metro!<br />
* Ship a significant feature in the UI, such as:<br />
** Enable add-on support in Metro, a high visibility feature<br />
** Design & build a new bookmarks management, or new ways for users to save stuff for later<br />
** Implement Private Browsing<br />
* Requires access to a Windows 8 machine<br />
=== Project B: QA Engineering ===<br />
* Help us ship a quality 1.0!<br />
* Write test plans for new features<br />
* Test, puzzle out, and break the latest features for the new browser<br />
* Write automated tests & learn the ins & outs of different test suites<br />
* Access what is missing in the current test coverage<br />
** and develop a plan to fix it<br />
* Puzzle out bugs, pain points<br />
* Requires access to a windows 8 machine<br />
<br />
==Communications==<br />
* #opw on irc.mozilla.org (please ping tjc with questions so we know you're there)<br />
** For more information on getting on IRC, check out [http://wiki.mozilla.org/IRC this tutorial]<br />
* #rust on irc.mozilla.org is the general Rust development and discussion channel -- it's a friendly place!<br />
* #servo on irc.mozilla.org is where the Servo developers are.<br />
* #mozillians on irc.mozilla.org is where Community Builders talk.<br />
* #windev is where the Metro/Windows team talks.<br />
* [https://mail.mozilla.org/listinfo/rust-dev rust-dev] is the mailing list for Rust discussion.<br />
* [https://lists.mozilla.org/listinfo/dev-servo dev-servo] is the mailing list for Servo discussion.<br />
* [https://mail.mozilla.org/listinfo/community-building community-building] is the mailing list for Community Building discussion.<br />
* metro@mozilla.org is the mailing list for Windows Metro discussion<br />
<br />
==First Contribution(s)==<br />
===Start with these===<br />
* Create a [http://mozillians.org/ Mozillians profile] (and a Persona)<br />
* Get a [http://bugzilla.mozilla.org/ Bugzilla] account<br />
* For Rust or Servo, please create a [https://github.com/ Github] account if you don't have one already.<br />
<br />
===Contributions for Rust===<br />
<br />
We use the git version control system for Rust, and Rust's code repository and issue tracker are hosted on [http://github.com/ Github]. If you've used other version control systems but not git, [http://geekchick77.dreamwidth.org/2360.html this post] may be helpful. If you've never used a version control system before, you will want to educate yourself about the basics of how they work.<br />
<br />
For your first contribution, pick a bug from [https://github.com/mozilla/rust/issues the issue tracker] to work on, and fix it. Submitting a work in progress is fine, so long as it passes tests. You will want to read both the [https://github.com/mozilla/rust/wiki/Note-guide-for-new-contributors guide for new contributors] and the [https://github.com/mozilla/rust/wiki/Note-development-policy development policy]. The development policy explains the process for submitting a pull request. <br />
<br />
All of these bugs were open and not being actively worked on when we made the list on October 16, 2013 -- however, if a bug shows up in Github as "closed" or if there is a recent comment from someone working on it, we recommend that you look for a different bug.<br />
<br />
We don't recommend that you pick a bug at random, as some of them require a lot of knowledge about the compiler. We have compiled a list of [https://github.com/mozilla/rust/issues?direction=asc&labels=E-easy&sort=updated&state=open easy bugs]. Even the easy bugs may require a fair amount of knowledge, so we've made the following list of easy bugs that we especially recommend for a new contributor, sorted by category.<br />
<br />
We suggest that you pick a bug you might like to work on, then ask on the #opw or #rust IRC channel for advice on how to proceed. Many of these bugs are not self-explanatory and we don't expect you to work on one entirely on your own! Please ask for help; we're happy to give it :-)<br />
<br />
====Front-end====<br />
* [https://github.com/mozilla/rust/issues/8767 #8767], improving an error message about defining methods on a non-existent type<br />
* [https://github.com/mozilla/rust/issues/8763 #8763], similar to #8767<br />
* [https://github.com/mozilla/rust/issues/1433 #1433], implementing hexadecimal floating-point literals<br />
* [https://github.com/mozilla/rust/issues/2252 #2252], bounds checking for floating-point literals<br />
* [https://github.com/mozilla/rust/issues/7743 #7743], make lifetime variables ```name```s and not ```ident```s<br />
<br />
====Lint====<br />
* [https://github.com/mozilla/rust/issues/1766 #1766], add warning about re-defining the names of built-in types<br />
* [https://github.com/mozilla/rust/issues/6600 #6600], adding a warning pass for empty destructors and replacing existing code that uses empty destructors with the ```NonCopyable``` trait<br />
* [https://github.com/mozilla/rust/issues/4639 #4639], adding a warning for patterns that bind variables that have the same name as an ```enum``` variant<br />
====Libraries====<br />
* [https://github.com/mozilla/rust/issues/2181 #2181], adding a method to return system hardware information<br />
* [https://github.com/mozilla/rust/issues/6101 #6101], writing a version of ```std::os::glob``` that doesn't allocate memory<br />
* [https://github.com/mozilla/rust/issues/8635 #8635], adding a hybrid unbounded integer type to the standard library<br />
* [https://github.com/mozilla/rust/issues/6085 #6085], making standard library functions take Rust types instead of C types<br />
* [https://github.com/mozilla/rust/issues/5283 #5283], making ```std::hashmap``` use ```TotalEq```<br />
* [https://github.com/mozilla/rust/issues/5568 #5568], adding ```find_or_insert``` method for ```Map```s<br />
* ''Larger project'': [https://github.com/mozilla/rust/issues/6220 #6220], implementing an API for converting between numbers and strings (This could be partially implemented, or it could become a project for the whole 3 months.)<br />
<br />
====Testing and benchmarking====<br />
* [https://github.com/mozilla/rust/issues/9694 #9694], adding benchmarks for ```std::path```<br />
* [https://github.com/mozilla/rust/issues/3965 #3965], enabling Rust regression tests that are currently disabled (for this bug, pick 1 to 3 tests -- don't try to do them all!)<br />
* [https://github.com/mozilla/rust/issues/2776 #2776], adding more shootout benchmarks (pick one)<br />
<br />
===Contributions for Servo===<br />
Similarly to Rust, [https://github.com/mozilla.servo Servo] is hosted on [http://github.com/ Github]. In order to work on Servo, you will need to have either a Linux or Mac OSX computer - we do not currently support Windows. The steps for contributing to Servo are:<br />
# [https://help.github.com/articles/set-up-git Create] a GitHub account<br />
# [https://help.github.com/articles/fork-a-repo Fork] the Servo project<br />
# Use git to clone the project locally, [https://github.com/mozilla/servo/blob/master/README.md build it], and verify that it works on your machine.<br />
# Look at the list of issues marked [https://github.com/mozilla/servo/issues?labels=E-easy&page=1&state=open Easy] to see if anything appeals to your interests.<br />
# Log in to #servo on [https://wiki.mozilla.org/IRC irc.mozilla.org] and ask for more clarification or data on a particular issue. The issues are often terse, but there are people available nearly all day who can clarify and help out if you are stuck.<br />
# Submit a [https://help.github.com/categories/63/articles Pull Request]! Per our [https://github.com/mozilla/servo/blob/master/CONTRIBUTING.md contributing] guidelines, put an "@GITHUB-NAME" for the corresponding reviewer that you spoke with about this project in IRC.<br />
<br />
===Contributions for Community Building===<br />
<br />
Visit http://www.mozilla.org/contribute/ and go through the process that new volunteers go through, choose a project, and see what you find interesting. Write up your proposed new project area as though you were a new volunteer, and let us know what the challenges are for you as a hypothetical new volunteer. Submit your proposed project to [https://mozillians.org/en-US/u/lshapiro/ Larissa Shapiro].<br />
<br />
===Contributions for Firefox for Metro===<br />
* Get a bugzilla account & irc program (the team runs on [https://wiki.mozilla.org/IRC irc.mozilla.org] )<br />
* Sign into #windev (wave hi to :ally)<br />
* Set up in general, [https://developer.mozilla.org/en-US/docs/Windows_8 set up], pull Mozilla Central, & build your copy of Firefox<br />
* Set up for metro, [https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally local build]<br />
* Ping :ally or :mbrubeck or :mfinkle in #windev to let us know that you've made it through and talk about next steps.</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=704013Firefox/Windows 8 Integration2013-09-06T20:26:47Z<p>Anaaktgeboren: /* Testing */</p>
<hr />
<div>== Wiki ==<br />
<br />
* [https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc.<br />
* [[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
* [https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
* [[Windows8|Metro Project Status]] - not really in use.<br />
* [[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 Windows 8 (desktop)]<br />
* [[Firefox/Windows 8 Metro Style Guides]] - coding standards and UI guidelines<br />
<br />
== Useful Bugzilla Queries ==<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;list_id=5745479 Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-1-0=notsubstring;list_id=5756053;field0-1-0=status_whiteboard;field0-0-0=status_whiteboard;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;value0-2-0=MetroV1;value0-1-0=feature%3Dstory;field0-2-0=short_desc;type0-0-0=notsubstring;value0-0-0=feature%3Depic;type0-2-0=notsubstring Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
* Minus feature=story, epic, and MetroV1<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-7-0=notsubstring;value0-7-0=feature%3Ddefect;field0-3-0=status_whiteboard;type0-1-0=notequals;type0-5-0=notsubstring;value0-5-0=feature%3Dwork;value0-4-0=feature%3Dstory;list_id=5745413;field0-1-0=blocked;field0-0-0=blocked;type0-4-0=notsubstring;resolution=---;field0-6-0=status_whiteboard;value0-3-0=feature%3Depic;field0-7-0=status_whiteboard;query_format=advanced;value0-2-0=MetroV1;value0-6-0=feature%3Dchange;value0-1-0=842686;type0-3-0=notsubstring;field0-2-0=short_desc;field0-5-0=status_whiteboard;field0-4-0=status_whiteboard;type0-6-0=notsubstring;type0-0-0=notequals;value0-0-0=841214;type0-2-0=notsubstring;product=Firefox%20for%20Metro Untagged Bugs]<br />
* Not blocked by various pm triage tracking bugs<br />
* Whiteboard does not contain feature=epic, work, change, defect, story<br />
* Summary does not contain 'MetroV1'<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?chfield=%5BBug%20creation%5D;chfieldfrom=-72h;known_name=Last%20Three%20Days;columnlist=opendate%2Cbug_severity%2Cpriority%2Cop_sys%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc;resolution=---;op_sys=Windows%20XP;op_sys=Windows%20Vista;op_sys=Windows%207;op_sys=Windows%208;op_sys=Windows%208%20Metro;query_based_on=Last%20Three%20Days;chfieldto=Now;query_format=advanced;product=Firefox%20for%20Metro;list_id=5745420 Last three days]<br />
<br />
* Bugs filed against product Metro Firefox in the last three days<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform]<br />
<br />
* Core, Toolkit, mozilla.org<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* Style guidelines of all types can be found on https://wiki.mozilla.org/Firefox/Windows_8_Metro_Style_Guides<br />
* the front end code is to be literally a user friendly. it helps developers to get understood easily.<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Nightly Builds ===<br />
<br />
Update: 6/24/2013<br />
<br />
Nightly builds are now being generated on mozilla-central.<br />
<br />
Nightly builds off the mozilla-central repository are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
<br />
For more detailed help on installing / setting the browser as the default, visit the [https://support.mozilla.org/en-US/kb/how-do-i-install-windows-8-metro-style-firefox Metro Firefox support page].<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/topcrasher/byversion/MetroFirefox/22.0a1/7 Firefox for Metro]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To install:<br />
<br />
* Download the newest firefox-(rev).0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe on the desktop<br />
* If prompted by Windows, select Nightly/Aurora/Firefox as the default.<br />
* Open Options -> Advanced -> General and click the "Make Firefox the default browser" button. This will open Windows Control Panel where you will need to select the channel build you are testing and set the defaults.<br />
<br />
=== Building Locally ===<br />
<br />
Updated 5/21/2013<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild] (version 1.7 required)<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
* Install [http://www.microsoft.com/en-us/download/confirmation.aspx?id=6812 DirectX SDK (June 2010)]<br />
<br />
* For VC 2010 builds:<br />
** Modify the the following header in the sdk:<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
If you use both VC 2010 and VC 2012 (or plan to install VC 2012 in the near future) you might want to instead use the following patch, which reverts to the original code under VC 2012 and later:<br />
<pre><br />
--- asyncinfo.h.orig 2013-05-21 08:47:49 -0400<br />
+++ asyncinfo.h 2013-05-21 08:48:55 -0400<br />
@@ -58,17 +58,21 @@<br />
/* interface __MIDL_itf_asyncinfo_0000_0000 */<br />
/* [local] */ <br />
<br />
// Microsoft Windows<br />
// Copyright (c) Microsoft Corporation. All rights reserved.<br />
#pragma once<br />
#ifdef __cplusplus<br />
namespace ABI { namespace Windows { namespace Foundation {<br />
+#if defined (_MSC_VER) && _MSC_VER >= 1700<br />
enum class AsyncStatus {<br />
+#else<br />
+enum AsyncStatus {<br />
+#endif<br />
Started = 0,<br />
Completed, <br />
Canceled, <br />
Error,<br />
};<br />
} } } // ABI::Windows:::Foundation<br />
using ABI::Windows::Foundation::AsyncStatus;<br />
#ifndef _HIDE_GLOBAL_ASYNC_STATUS<br />
</pre><br />
<br />
* For Express versions of VS:<br />
** Install [http://www.microsoft.com/en-us/download/details.aspx?id=11800 the Windows Driver Toolkit, version 7.1.0] - Version 7.1.0 is needed because it contains the necessary ATL headers that express VS lacks.<br />
** Add the following to start-msvc*.bat file near the end just before the line that reads cd "%USERPROFILE%" (assumes WinDDK was installed in "C:\WinDDK\7600.16385.1"):<br />
<pre><br />
set "INCLUDE=C:\WinDDK\7600.16385.1\inc\atl71;%INCLUDE%"<br />
set "LIB=C:\WinDDK\7600.16385.1\lib\ATL\i386;%LIB%"<br />
</pre><br />
<br />
* [https://developer.mozilla.org/en-US/docs/Simple_Firefox_build#Get_the_source Check out mozilla-central]. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* [https://developer.mozilla.org/en-US/docs/Simple_Firefox_build#Building Build Firefox].<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Firefox/Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
Currently, some of the selection tests may fail (specifically, browser_selection_frame_textarea.js) if the device and CSS pixels are out of sync. To solve this, you may need to change the following pref in about:config to the following value.<br />
<br />
layout.css.devPixelsPerPx = 1.0 (default is -1.0, which makes Firefox autoscale CSS pixels)<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
mach mochitest-metro<br />
(old way was pymake mochitest-metro-chrome)<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
On Mac, you might need to run "./mach build browser" after your build completes. For details, see {{bug|847807}}.<br />
<br />
* there is a problem with html5 EMBED tag. '''an EMBED tag is basically to play media files.''' but we can't use this on mac.<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that show up in the console. The following environment variable is assumed for the Metro environment:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
** If you start the browser and see a blank screen with your patch containing startDOMi() applied, it probably means the extension hasn't been enabled/installed properly. Often its the last step of flipping values.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.json file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Set the 'active' property to boolean true and the userDisabled property to boolean false.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== Crash Testing ===<br />
<br />
To test the Crash Reporter UI and other crash-related behavior, you can make use of install the [http://people.mozilla.com/~tmielczarek/crashme/ Crash Me addon] (sources are on [http://code.google.com/p/crashme/ Google Code].) This extension is already Metro Firefox ready, so you just need to follow similar steps as for the DOM Inspector to enable it. <br />
* Install the Crash Me addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'crashme@ted.mielczarek.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* - OR - you can just download and unzip the .xpi file into a crashme@ted.mielczarek.org folder in your profile extensions directory<br />
* To allow discovery and install of add-ons, set extensions.autoDisableScopes to 15, either via your local metro.js or in about:config <br />
* If you are using a local build, you may need to edit the metroapp.ini (generated from the metroapp.ini.in template) to ensure the Crash Reporter Enabled=1 flag is set. <br />
<br />
To use, you'll find a new "Crash Now!" entry in the Settings charm. Tap it to crash.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* In Explorer on the tablet purge any unused space on C, including old Windows installation files, using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main disk partition into two. A 20GB partition for mozilla related bits is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your debugging workstation does not use.<br />
* Right-click the new mozilla drive in Explorer and select Share. Share the volume using your login credentials or you can also openly share to "Everyone" if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation browse to the tablet share and map it to a local drive using the same drive letter you used for the tablet drive. This insures object source has the same path info on both machines.<br />
* Install Visual Studio and mozilla-build on the tablet.<br />
* Checkout mozilla-central on the mozilla partition of the tablet, then build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up a remote debug tools folder via search, open this and launch the remote debug monitor. Run the x64 version if on 64 bit os, x86 otherwise. (Pin this to your start menu for easy access.)<br />
* Under the monitor's tools menu, add permission for your login credentials or "Everyone" for remote debugging.<br />
* On the workstation, create a blank C++ debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session. Most debug output the browser spits out should be transferred over to the remote debugger.<br />
<br />
Note you might have to fiddle with access permissions a bit. Opening everything up to Everyone saves a lot of time, but might not be the most secure environment, depending on your situation.<br />
<br />
=== Diagnosing Startup Problems ===<br />
<br />
Due to the embedded nature of metro browsers, diagnosing startup problems can be a bit of a pain. There are a few things you can do to help devs figure out what's going wrong.<br />
<br />
<b><br />
1) Launch the metro browser interface on desktop to confirm the install is working.<br />
</b><br />
<br />
* Navigate to firefox's install location in explorer<br />
* Hold shift, right-click the folder with firefox.exe and select open command prompt.<br />
* in the prompt type 'firefox.exe -metrodesktop'<br />
<br />
The metro front end should launch in a window on the desktop. If not, try uninstalling and re-installing. If that doesn't help, please file a bug.<br />
<br />
<b><br />
2) Check Direct3D start up check results<br />
</b><br />
<br />
Using regedit.exe, check under the following key for a value named 'MetroD3DAvailable':<br />
<br />
HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox<br />
<br />
If the value is 0, Direct3D startup checks failed. Please file a bug, and post the Graphics section of your desktop browser's about:support section to the bug. If there is no value, please file a bug. If the value is 1, startup checks succeeded.<br />
<br />
<b><br />
3) Check for submitted crashes reports<br />
</b><br />
<br />
To check if metro fx is generating and submitting crash reports open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\submitted\<br />
<br />
If the folder exists and contains text files please file a bug and copy the contents of a few of the most recent files into the bug.<br />
<br />
<b><br />
4) Check for unsubmitted crashes reports<br />
</b><br />
<br />
Metro firefox can not submit crashes for analysis unless the browser fully starts ({{bug|797023}}).<br />
<br />
To check if metro fx is crashing on startup, open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\<br />
<br />
In this folder look for two files:<br />
<br />
LastCrash lastCrashFilename<br />
<br />
If both files are present, delete them, and try restarting Metro Firefox again. After doing this, check the folder again. If the files return, a startup crash is likely.<br />
<br />
There are two things you can do t this point to help diagnose the problem:<br />
<br />
<b>Option 1</b>: Use Desktop Firefox to submit the crash report to Mozilla's crash server -<br />
<br />
* open lastCrashFilename with notepad.exe<br />
* copy the temp path and note the file name of the crash report<br />
* open the temp path in explorer and locate the two files associated with the report.<br />
<br />
There will be two files, both will have the same file name (a uuid string) and the extensions .dmp and .extra.<br />
<br />
* shutdown desktop firefox if it is running<br />
* In explorer, copy both files from their location into the follow folder:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\Firefox\Crash Reports\pending\<br />
<br />
* start Desktop Firefox.<br />
* Navigate to 'about:crashes'.<br />
* find the uuid of the report you copied and click on its link<br />
<br />
If the link does not resolve to a crash server crash report immediately, wait a few minutes and try again. Once the link resolves, file a bug and copy the report's link into the bug report.<br />
<br />
<b>Option 2</b>:<br />
<br />
File a bug and contact a dev. who you can share your crash report with. Note crash reports can contain user specific info, do not submit these files to bugzilla as attachments.<br />
<br />
<b><br />
4) Logging startup<br />
</b><br />
<br />
..<br />
<br />
<b><br />
5) CEH logging<br />
</b><br />
<br />
..<br />
<br />
== Testing Harness ==<br />
<br />
Builds generate a test harness (dist/bin/metrotestharness.exe) that can be used to launch the metro browser into the immersive environment. This harness is also packed up with the test zips used in automation testing.<br />
<br />
Metro Firefox can't accept standard command line parameters since it must be launched by Windows. The harness acts as a pass through for mozilla command line parameters firefox.exe can accept. Incoming params are written out to an ini file @ dist/bin and read in via [http://mxr.mozilla.org/mozilla-central/source/browser/app/nsBrowserApp.cpp nsBrowserApp] when the browser starts up.<br />
<br />
By default the test harness assumes the default browser (firefox.exe) is in the same folder metrotestharness.exe is located. If you want to launch the default browser at a different location from metrotestharness.exe, you must specify a firefox path using -firefoxpath (fullpath):<br />
<br />
<pre>metrotestharness.exe -firefoxpath T:\Mozilla\objmcrel\dist\bin\ -url www.mozilla.org</pre><br />
<br />
The test harness will need *write* permission to this location to write out a command line arg ini file.<br />
<br />
[http://mxr.mozilla.org/mozilla-central/source/browser/metro/shell/testing/metrotestharness.cpp harness source]<br />
<br />
== Using Devtools ==<br />
* Tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=850019<br />
** There are known issues with the profiler. All other parts should be functional, modulo the refactoring work the devtools team is doing on them.<br />
* This hooks into the tools developed & maintained by the devtools team.<br />
* They have been refactoring & improving their tools, so it <strong>highly encouraged</strong> to use Nightly builds on both sides of the pairing if possible.<br />
<br />
* Before you start<br />
** You must have metro installed & working<br />
** You must access to a classic/desktop fx. This need not be a local build<br />
** If you are connecting remotely, you must make sure both machines can ping each other before starting. This will save you a lot of grief later<br />
*** on windows ipconfig in the cmdline is helpful in getting your ip address<br />
*** on windows 8 this usually means disabling the firewall (not encouraged) or adding inbound/outbound firewall rules to allow them to connect.<br />
**** If you need it, Peter in IT now knows a fair bit about setting up those rules if you get lost or stuck.<br />
** If you are on wifi, both devices must be on the same network to communicate. Mozilla != Mozilla-G. <br />
*** It sounds silly but some of the windows devices only see Mozilla-G and the older company issued thinkpads do not have the hardware for it.<br />
<br />
* Setup<br />
** Go to about:config on classic/desktop fx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** Check that these values are what you want<br />
**** devtools.debugger.remote-port -> 6000 (I'd leave this one alone unless you have a compelling reason to change it)<br />
*** If you don't have these, you'll probably want these as well<br />
**** devtools.debugger.log -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
** Restart classic/desktop fx<br />
*** You need to restart for the next step to work.<br />
** Navigate Firefox button -> Web Developer -> "Connect.." entry between the Error Console" & "Get More Tools" Entry<br />
*** https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up is what this step is based on<br />
** Go to about:config on metrofx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** and you may want<br />
**** devtools.debugger.log -> true<br />
**** devtools.errorconsole.enabled -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
*** devtools.debugger.remote-port -> 6000 (again I'd leave this one alone)<br />
*** It is unclear if a restart is required. I frequently do in the test-build-dev cycle anyway.<br />
** Make sure metrofx is started (and not suspended)<br />
** In classic fx, click the "Connect..." entry <br />
*** Depending on your version, this will launch a new tab or a new panel on firefox<br />
*** Enter the ip of metrofx if you are connecting remotely and the port number if you've changed them.<br />
*** If you are connecting on a localhost, you shouldn't need to change the default settings.<br />
** Click the connect button in classic fx<br />
** On metrofx a strap(the metro version of the modal dialog) will appear about an incoming connection.<br />
*** Click/tap "allow"<br />
** On classic fx, the connect page will reload with a list of active tabs & processes. Usually 'main process' is the most interesting.<br />
** The devtools console will appear & the aforementioned tab on classic fx will disappear<br />
** Sally forth & debug!<br />
<br />
* Notes<br />
** I usually pair on localhost, using an external monitor so I can see metrofx & classicfx at the same time.<br />
** If you are using localhost without an external monitor, beware of windows suspending the metrofx while its waiting for the incoming connection. This will cause the pairing to fail.<br />
** While you can pair classic/metrofx running out of the same obj dir, I frequently experienced unexpected hangs and crashes as a result.<br />
** if you close the devtools window, this usually results in the metro browser shutting down<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=687978Firefox/Windows 8 Integration2013-07-31T18:23:02Z<p>Anaaktgeboren: /* DOM Inspector */</p>
<hr />
<div>== Wiki ==<br />
<br />
* [https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc.<br />
* [[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
* [https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
* [[Windows8|Metro Project Status]] - not really in use.<br />
* [[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 Windows 8 (desktop)]<br />
* [[Firefox/Windows 8 Metro Style Guides]] - coding standards and UI guidelines<br />
<br />
== Useful Bugzilla Queries ==<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;list_id=5745479 Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-1-0=notsubstring;list_id=5756053;field0-1-0=status_whiteboard;field0-0-0=status_whiteboard;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;value0-2-0=MetroV1;value0-1-0=feature%3Dstory;field0-2-0=short_desc;type0-0-0=notsubstring;value0-0-0=feature%3Depic;type0-2-0=notsubstring Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
* Minus feature=story, epic, and MetroV1<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-7-0=notsubstring;value0-7-0=feature%3Ddefect;field0-3-0=status_whiteboard;type0-1-0=notequals;type0-5-0=notsubstring;value0-5-0=feature%3Dwork;value0-4-0=feature%3Dstory;list_id=5745413;field0-1-0=blocked;field0-0-0=blocked;type0-4-0=notsubstring;resolution=---;field0-6-0=status_whiteboard;value0-3-0=feature%3Depic;field0-7-0=status_whiteboard;query_format=advanced;value0-2-0=MetroV1;value0-6-0=feature%3Dchange;value0-1-0=842686;type0-3-0=notsubstring;field0-2-0=short_desc;field0-5-0=status_whiteboard;field0-4-0=status_whiteboard;type0-6-0=notsubstring;type0-0-0=notequals;value0-0-0=841214;type0-2-0=notsubstring;product=Firefox%20for%20Metro Untagged Bugs]<br />
* Not blocked by various pm triage tracking bugs<br />
* Whiteboard does not contain feature=epic, work, change, defect, story<br />
* Summary does not contain 'MetroV1'<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?chfield=%5BBug%20creation%5D;chfieldfrom=-72h;known_name=Last%20Three%20Days;columnlist=opendate%2Cbug_severity%2Cpriority%2Cop_sys%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc;resolution=---;op_sys=Windows%20XP;op_sys=Windows%20Vista;op_sys=Windows%207;op_sys=Windows%208;op_sys=Windows%208%20Metro;query_based_on=Last%20Three%20Days;chfieldto=Now;query_format=advanced;product=Firefox%20for%20Metro;list_id=5745420 Last three days]<br />
<br />
* Bugs filed against product Metro Firefox in the last three days<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform]<br />
<br />
* Core, Toolkit, mozilla.org<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* Style guidelines of all types can be found on https://wiki.mozilla.org/Firefox/Windows_8_Metro_Style_Guides<br />
* the front end code is to be literally a user friendly. it helps developers to get understood easily.<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Nightly Builds ===<br />
<br />
Update: 6/24/2013<br />
<br />
Nightly builds are now being generated on mozilla-central.<br />
<br />
Nightly builds off the mozilla-central repository are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
<br />
For more detailed help on installing / setting the browser as the default, visit the [https://support.mozilla.org/en-US/kb/how-do-i-install-windows-8-metro-style-firefox Metro Firefox support page].<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/topcrasher/byversion/MetroFirefox/22.0a1/7 Firefox for Metro]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To install:<br />
<br />
* Download the newest firefox-(rev).0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe on the desktop<br />
* If prompted by Windows, select Nightly/Aurora/Firefox as the default.<br />
* Open Options -> Advanced -> General and click the "Make Firefox the default browser" button. This will open Windows Control Panel where you will need to select the channel build you are testing and set the defaults.<br />
<br />
=== Building Locally ===<br />
<br />
Updated 5/21/2013<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild] (version 1.7 required)<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
* Install [http://www.microsoft.com/en-us/download/confirmation.aspx?id=6812 DirectX SDK (June 2010)]<br />
<br />
* For VC 2010 builds:<br />
** Modify the the following header in the sdk:<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
If you use both VC 2010 and VC 2012 (or plan to install VC 2012 in the near future) you might want to instead use the following patch, which reverts to the original code under VC 2012 and later:<br />
<pre><br />
--- asyncinfo.h.orig 2013-05-21 08:47:49 -0400<br />
+++ asyncinfo.h 2013-05-21 08:48:55 -0400<br />
@@ -58,17 +58,21 @@<br />
/* interface __MIDL_itf_asyncinfo_0000_0000 */<br />
/* [local] */ <br />
<br />
// Microsoft Windows<br />
// Copyright (c) Microsoft Corporation. All rights reserved.<br />
#pragma once<br />
#ifdef __cplusplus<br />
namespace ABI { namespace Windows { namespace Foundation {<br />
+#if defined (_MSC_VER) && _MSC_VER >= 1700<br />
enum class AsyncStatus {<br />
+#else<br />
+enum AsyncStatus {<br />
+#endif<br />
Started = 0,<br />
Completed, <br />
Canceled, <br />
Error,<br />
};<br />
} } } // ABI::Windows:::Foundation<br />
using ABI::Windows::Foundation::AsyncStatus;<br />
#ifndef _HIDE_GLOBAL_ASYNC_STATUS<br />
</pre><br />
<br />
* For Express versions of VS:<br />
** Install [http://www.microsoft.com/en-us/download/details.aspx?id=11800 the Windows Driver Toolkit, version 1.7] - Version 7.1 is needed because it contains the necessary ATL headers that express VS lacks.<br />
** Add the following to start-msvc*.bat file near the end just before the line that reads cd "%USERPROFILE%" (assumes WinDDK was installed in "C:\WinDDK\7600.16385.1"):<br />
<pre><br />
set "INCLUDE=C:\WinDDK\7600.16385.1\inc\atl71;%INCLUDE%"<br />
set "LIB=C:\WinDDK\7600.16385.1\lib\ATL\i386;%LIB%"<br />
</pre><br />
<br />
* Check out mozilla-central. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* Config and build m-c<br />
<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Firefox/Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
Currently, some of the selection tests may fail (specifically, browser_selection_frame_textarea.js) if the device and CSS pixels are out of sync. To solve this, you may need to change the following pref in about:config to the following value.<br />
<br />
layout.css.devPixelsPerPx = 1.0 (default is -1.0, which makes Firefox autoscale CSS pixels)<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
pymake mochitest-metro-chrome<br />
<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
On Mac, you might need to run "./mach build browser" after your build completes. For details, see {{bug|847807}}.<br />
<br />
* there is a problem with html5 EMBED tag. '''an EMBED tag is basically to play media files.''' but we can't use this on mac.<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that show up in the console. The following environment variable is assumed for the Metro environment:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
** If you start the browser and see a blank screen with your patch containing startDOMi() applied, it probably means the extension hasn't been enabled/installed properly. Often its the last step of flipping values.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.sqlite database file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Using your favorite sqlite tool (the [https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ SQLite Manager Add-on] works), find the inspector's entry in the 'addon' table and set the 'active' field to integer 1, and the userDisabled field to integer value 0.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* In Explorer on the tablet purge any unused space on C, including old Windows installation files, using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main disk partition into two. A 20GB partition for mozilla related bits is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your debugging workstation does not use.<br />
* Right-click the new mozilla drive in Explorer and select Share. Share the volume using your login credentials or you can also openly share to "Everyone" if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation browse to the tablet share and map it to a local drive using the same drive letter you used for the tablet drive. This insures object source has the same path info on both machines.<br />
* Install Visual Studio and mozilla-build on the tablet.<br />
* Checkout mozilla-central on the mozilla partition of the tablet, then build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up a remote debug tools folder via search, open this and launch the remote debug monitor. Run the x64 version if on 64 bit os, x86 otherwise. (Pin this to your start menu for easy access.)<br />
* Under the monitor's tools menu, add permission for your login credentials or "Everyone" for remote debugging.<br />
* On the workstation, create a blank C++ debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session. Most debug output the browser spits out should be transferred over to the remote debugger.<br />
<br />
Note you might have to fiddle with access permissions a bit. Opening everything up to Everyone saves a lot of time, but might not be the most secure environment, depending on your situation.<br />
<br />
=== Diagnosing Startup Problems ===<br />
<br />
Due to the embedded nature of metro browsers, diagnosing startup problems can be a bit of a pain. There are a few things you can do to help devs figure out what's going wrong.<br />
<br />
<b><br />
1) Launch the metro browser interface on desktop to confirm the install is working.<br />
</b><br />
<br />
* Navigate to firefox's install location in explorer<br />
* Hold shift, right-click the folder with firefox.exe and select open command prompt.<br />
* in the prompt type 'firefox.exe -metrodesktop'<br />
<br />
The metro front end should launch in a window on the desktop. If not, try uninstalling and re-installing. If that doesn't help, please file a bug.<br />
<br />
<b><br />
2) Check Direct3D start up check results<br />
</b><br />
<br />
Using regedit.exe, check under the following key for a value named 'MetroD3DAvailable':<br />
<br />
HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox<br />
<br />
If the value is 0, Direct3D startup checks failed. Please file a bug, and post the Graphics section of your desktop browser's about:support section to the bug. If there is no value, please file a bug. If the value is 1, startup checks succeeded.<br />
<br />
<b><br />
3) Check for submitted crashes reports<br />
</b><br />
<br />
To check if metro fx is generating and submitting crash reports open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\submitted\<br />
<br />
If the folder exists and contains text files please file a bug and copy the contents of a few of the most recent files into the bug.<br />
<br />
<b><br />
4) Check for unsubmitted crashes reports<br />
</b><br />
<br />
Metro firefox can not submit crashes for analysis unless the browser fully starts ({{bug|797023}}).<br />
<br />
To check if metro fx is crashing on startup, open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\<br />
<br />
In this folder look for two files:<br />
<br />
LastCrash lastCrashFilename<br />
<br />
If both files are present, delete them, and try restarting Metro Firefox again. After doing this, check the folder again. If the files return, a startup crash is likely.<br />
<br />
There are two things you can do t this point to help diagnose the problem:<br />
<br />
<b>Option 1</b>: Use Desktop Firefox to submit the crash report to Mozilla's crash server -<br />
<br />
* open lastCrashFilename with notepad.exe<br />
* copy the temp path and note the file name of the crash report<br />
* open the temp path in explorer and locate the two files associated with the report.<br />
<br />
There will be two files, both will have the same file name (a uuid string) and the extensions .dmp and .extra.<br />
<br />
* shutdown desktop firefox if it is running<br />
* In explorer, copy both files from their location into the follow folder:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\Firefox\Crash Reports\pending\<br />
<br />
* start Desktop Firefox.<br />
* Navigate to 'about:crashes'.<br />
* find the uuid of the report you copied and click on its link<br />
<br />
If the link does not resolve to a crash server crash report immediately, wait a few minutes and try again. Once the link resolves, file a bug and copy the report's link into the bug report.<br />
<br />
<b>Option 2</b>:<br />
<br />
File a bug and contact a dev. who you can share your crash report with. Note crash reports can contain user specific info, do not submit these files to bugzilla as attachments.<br />
<br />
<b><br />
4) Logging startup<br />
</b><br />
<br />
..<br />
<br />
<b><br />
5) CEH logging<br />
</b><br />
<br />
..<br />
<br />
== Testing Harness ==<br />
<br />
Builds generate a test harness (dist/bin/metrotestharness.exe) that can be used to launch the metro browser into the immersive environment. This harness is also packed up with the test zips used in automation testing.<br />
<br />
Metro Firefox can't accept standard command line parameters since it must be launched by Windows. The harness acts as a pass through for mozilla command line parameters firefox.exe can accept. Incoming params are written out to an ini file @ dist/bin and read in via [http://mxr.mozilla.org/mozilla-central/source/browser/app/nsBrowserApp.cpp nsBrowserApp] when the browser starts up.<br />
<br />
By default the test harness assumes the default browser (firefox.exe) is in the same folder metrotestharness.exe is located. If you want to launch the default browser at a different location from metrotestharness.exe, you must specify a firefox path using -firefoxpath (fullpath):<br />
<br />
<pre>metrotestharness.exe -firefoxpath T:\Mozilla\objmcrel\dist\bin\ -url www.mozilla.org</pre><br />
<br />
The test harness will need *write* permission to this location to write out a command line arg ini file.<br />
<br />
[http://mxr.mozilla.org/mozilla-central/source/browser/metro/shell/testing/metrotestharness.cpp harness source]<br />
<br />
== Using Devtools ==<br />
* Tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=850019<br />
** There are known issues with the profiler. All other parts should be functional, modulo the refactoring work the devtools team is doing on them.<br />
* This hooks into the tools developed & maintained by the devtools team.<br />
* They have been refactoring & improving their tools, so it <strong>highly encouraged</strong> to use Nightly builds on both sides of the pairing if possible.<br />
<br />
* Before you start<br />
** You must have metro installed & working<br />
** You must access to a classic/desktop fx. This need not be a local build<br />
** If you are connecting remotely, you must make sure both machines can ping each other before starting. This will save you a lot of grief later<br />
*** on windows ipconfig in the cmdline is helpful in getting your ip address<br />
*** on windows 8 this usually means disabling the firewall (not encouraged) or adding inbound/outbound firewall rules to allow them to connect.<br />
**** If you need it, Peter in IT now knows a fair bit about setting up those rules if you get lost or stuck.<br />
** If you are on wifi, both devices must be on the same network to communicate. Mozilla != Mozilla-G. <br />
*** It sounds silly but some of the windows devices only see Mozilla-G and the older company issued thinkpads do not have the hardware for it.<br />
<br />
* Setup<br />
** Go to about:config on classic/desktop fx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** Check that these values are what you want<br />
**** devtools.debugger.remote-port -> 6000 (I'd leave this one alone unless you have a compelling reason to change it)<br />
*** If you don't have these, you'll probably want these as well<br />
**** devtools.debugger.log -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
** Restart classic/desktop fx<br />
*** You need to restart for the next step to work.<br />
** Navigate Firefox button -> Web Developer -> "Connect.." entry between the Error Console" & "Get More Tools" Entry<br />
*** https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up is what this step is based on<br />
** Go to about:config on metrofx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** and you may want<br />
**** devtools.debugger.log -> true<br />
**** devtools.errorconsole.enabled -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
*** devtools.debugger.remote-port -> 6000 (again I'd leave this one alone)<br />
*** It is unclear if a restart is required. I frequently do in the test-build-dev cycle anyway.<br />
** Make sure metrofx is started (and not suspended)<br />
** In classic fx, click the "Connect..." entry <br />
*** Depending on your version, this will launch a new tab or a new panel on firefox<br />
*** Enter the ip of metrofx if you are connecting remotely and the port number if you've changed them.<br />
*** If you are connecting on a localhost, you shouldn't need to change the default settings.<br />
** Click the connect button in classic fx<br />
** On metrofx a strap(the metro version of the modal dialog) will appear about an incoming connection.<br />
*** Click/tap "allow"<br />
** On classic fx, the connect page will reload with a list of active tabs & processes. Usually 'main process' is the most interesting.<br />
** The devtools console will appear & the aforementioned tab on classic fx will disappear<br />
** Sally forth & debug!<br />
<br />
* Notes<br />
** I usually pair on localhost, using an external monitor so I can see metrofx & classicfx at the same time.<br />
** If you are using localhost without an external monitor, beware of windows suspending the metrofx while its waiting for the incoming connection. This will cause the pairing to fail.<br />
** While you can pair classic/metrofx running out of the same obj dir, I frequently experienced unexpected hangs and crashes as a result.<br />
** if you close the devtools window, this usually results in the metro browser shutting down<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=676985Firefox/Windows 8 Integration2013-07-16T19:30:44Z<p>Anaaktgeboren: /* Using Devtools */</p>
<hr />
<div>== Wiki ==<br />
<br />
* [https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc.<br />
* [[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
* [https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
* [[Windows8|Metro Project Status]] - not really in use.<br />
* [[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 Windows 8 (desktop)]<br />
* [[Firefox/Windows 8 Metro Style Guides]] - coding standards and UI guidelines<br />
<br />
== Useful Bugzilla Queries ==<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;list_id=5745479 Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-1-0=notsubstring;list_id=5756053;field0-1-0=status_whiteboard;field0-0-0=status_whiteboard;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;value0-2-0=MetroV1;value0-1-0=feature%3Dstory;field0-2-0=short_desc;type0-0-0=notsubstring;value0-0-0=feature%3Depic;type0-2-0=notsubstring Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
* Minus feature=story, epic, and MetroV1<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-7-0=notsubstring;value0-7-0=feature%3Ddefect;field0-3-0=status_whiteboard;type0-1-0=notequals;type0-5-0=notsubstring;value0-5-0=feature%3Dwork;value0-4-0=feature%3Dstory;list_id=5745413;field0-1-0=blocked;field0-0-0=blocked;type0-4-0=notsubstring;resolution=---;field0-6-0=status_whiteboard;value0-3-0=feature%3Depic;field0-7-0=status_whiteboard;query_format=advanced;value0-2-0=MetroV1;value0-6-0=feature%3Dchange;value0-1-0=842686;type0-3-0=notsubstring;field0-2-0=short_desc;field0-5-0=status_whiteboard;field0-4-0=status_whiteboard;type0-6-0=notsubstring;type0-0-0=notequals;value0-0-0=841214;type0-2-0=notsubstring;product=Firefox%20for%20Metro Untagged Bugs]<br />
* Not blocked by various pm triage tracking bugs<br />
* Whiteboard does not contain feature=epic, work, change, defect, story<br />
* Summary does not contain 'MetroV1'<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?chfield=%5BBug%20creation%5D;chfieldfrom=-72h;known_name=Last%20Three%20Days;columnlist=opendate%2Cbug_severity%2Cpriority%2Cop_sys%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc;resolution=---;op_sys=Windows%20XP;op_sys=Windows%20Vista;op_sys=Windows%207;op_sys=Windows%208;op_sys=Windows%208%20Metro;query_based_on=Last%20Three%20Days;chfieldto=Now;query_format=advanced;product=Firefox%20for%20Metro;list_id=5745420 Last three days]<br />
<br />
* Bugs filed against product Metro Firefox in the last three days<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform]<br />
<br />
* Core, Toolkit, mozilla.org<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* Style guidelines of all types can be found on https://wiki.mozilla.org/Firefox/Windows_8_Metro_Style_Guides<br />
* the front end code is to be literally a user friendly. it helps developers to get understood easily.<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Nightly Builds ===<br />
<br />
Update: 6/24/2013<br />
<br />
Nightly builds are now being generated on mozilla-central.<br />
<br />
Nightly builds off the mozilla-central repository are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
<br />
For more detailed help on installing / setting the browser as the default, visit the [https://support.mozilla.org/en-US/kb/how-do-i-install-windows-8-metro-style-firefox Metro Firefox support page].<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/topcrasher/byversion/MetroFirefox/22.0a1/7 Firefox for Metro]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To install:<br />
<br />
* Download the newest firefox-(rev).0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe on the desktop<br />
* If prompted by Windows, select Nightly/Aurora/Firefox as the default.<br />
* Open Options -> Advanced -> General and click the "Make Firefox the default browser" button. This will open Windows Control Panel where you will need to select the channel build you are testing and set the defaults.<br />
<br />
=== Building Locally ===<br />
<br />
Updated 5/21/2013<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild] (version 1.7 required)<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
* Install [http://www.microsoft.com/en-us/download/confirmation.aspx?id=6812 DirectX SDK (June 2010)]<br />
<br />
* For VC 2010 builds:<br />
** Modify the the following header in the sdk:<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
If you use both VC 2010 and VC 2012 (or plan to install VC 2012 in the near future) you might want to instead use the following patch, which reverts to the original code under VC 2012 and later:<br />
<pre><br />
--- asyncinfo.h.orig 2013-05-21 08:47:49 -0400<br />
+++ asyncinfo.h 2013-05-21 08:48:55 -0400<br />
@@ -58,17 +58,21 @@<br />
/* interface __MIDL_itf_asyncinfo_0000_0000 */<br />
/* [local] */ <br />
<br />
// Microsoft Windows<br />
// Copyright (c) Microsoft Corporation. All rights reserved.<br />
#pragma once<br />
#ifdef __cplusplus<br />
namespace ABI { namespace Windows { namespace Foundation {<br />
+#if defined (_MSC_VER) && _MSC_VER >= 1700<br />
enum class AsyncStatus {<br />
+#else<br />
+enum AsyncStatus {<br />
+#endif<br />
Started = 0,<br />
Completed, <br />
Canceled, <br />
Error,<br />
};<br />
} } } // ABI::Windows:::Foundation<br />
using ABI::Windows::Foundation::AsyncStatus;<br />
#ifndef _HIDE_GLOBAL_ASYNC_STATUS<br />
</pre><br />
<br />
* For Express versions of VS:<br />
** Install [http://www.microsoft.com/en-us/download/details.aspx?id=11800 the Windows Driver Toolkit, version 1.7] - Version 7.1 is needed because it contains the necessary ATL headers that express VS lacks.<br />
** Add the following to start-msvc*.bat file near the end just before the line that reads cd "%USERPROFILE%" (assumes WinDDK was installed in "C:\WinDDK\7600.16385.1"):<br />
<pre><br />
set "INCLUDE=C:\WinDDK\7600.16385.1\inc\atl71;%INCLUDE%"<br />
set "LIB=C:\WinDDK\7600.16385.1\lib\ATL\i386;%LIB%"<br />
</pre><br />
<br />
* Check out mozilla-central. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* Config and build m-c<br />
<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Firefox/Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
Currently, some of the selection tests may fail (specifically, browser_selection_frame_textarea.js) if the device and CSS pixels are out of sync. To solve this, you may need to change the following pref in about:config to the following value.<br />
<br />
layout.css.devPixelsPerPx = 1.0 (default is -1.0, which makes Firefox autoscale CSS pixels)<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
pymake mochitest-metro-chrome<br />
<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
On Mac, you might need to run "./mach build browser" after your build completes. For details, see {{bug|847807}}.<br />
<br />
* there is a problem with html5 EMBED tag. '''an EMBED tag is basically to play media files.''' but we can't use this on mac.<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that show up in the console. The following environment variable is assumed for the Metro environment:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.sqlite database file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Using your favorite sqlite tool (the [https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ SQLite Manager Add-on] works), find the inspector's entry in the 'addon' table and set the 'active' field to integer 1, and the userDisabled field to integer value 0.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* In Explorer on the tablet purge any unused space on C, including old Windows installation files, using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main disk partition into two. A 20GB partition for mozilla related bits is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your debugging workstation does not use.<br />
* Right-click the new mozilla drive in Explorer and select Share. Share the volume using your login credentials or you can also openly share to "Everyone" if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation browse to the tablet share and map it to a local drive using the same drive letter you used for the tablet drive. This insures object source has the same path info on both machines.<br />
* Install Visual Studio and mozilla-build on the tablet.<br />
* Checkout mozilla-central on the mozilla partition of the tablet, then build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up a remote debug tools folder via search, open this and launch the remote debug monitor. Run the x64 version if on 64 bit os, x86 otherwise. (Pin this to your start menu for easy access.)<br />
* Under the monitor's tools menu, add permission for your login credentials or "Everyone" for remote debugging.<br />
* On the workstation, create a blank C++ debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session. Most debug output the browser spits out should be transferred over to the remote debugger.<br />
<br />
Note you might have to fiddle with access permissions a bit. Opening everything up to Everyone saves a lot of time, but might not be the most secure environment, depending on your situation.<br />
<br />
=== Diagnosing Startup Problems ===<br />
<br />
Due to the embedded nature of metro browsers, diagnosing startup problems can be a bit of a pain. There are a few things you can do to help devs figure out what's going wrong.<br />
<br />
<b><br />
1) Launch the metro browser interface on desktop to confirm the install is working.<br />
</b><br />
<br />
* Navigate to firefox's install location in explorer<br />
* Hold shift, right-click the folder with firefox.exe and select open command prompt.<br />
* in the prompt type 'firefox.exe -metrodesktop'<br />
<br />
The metro front end should launch in a window on the desktop. If not, try uninstalling and re-installing. If that doesn't help, please file a bug.<br />
<br />
<b><br />
2) Check Direct3D start up check results<br />
</b><br />
<br />
Using regedit.exe, check under the following key for a value named 'MetroD3DAvailable':<br />
<br />
HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox<br />
<br />
If the value is 0, Direct3D startup checks failed. Please file a bug, and post the Graphics section of your desktop browser's about:support section to the bug. If there is no value, please file a bug. If the value is 1, startup checks succeeded.<br />
<br />
<b><br />
3) Check for submitted crashes reports<br />
</b><br />
<br />
To check if metro fx is generating and submitting crash reports open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\submitted\<br />
<br />
If the folder exists and contains text files please file a bug and copy the contents of a few of the most recent files into the bug.<br />
<br />
<b><br />
4) Check for unsubmitted crashes reports<br />
</b><br />
<br />
Metro firefox can not submit crashes for analysis unless the browser fully starts ({{bug|797023}}).<br />
<br />
To check if metro fx is crashing on startup, open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\<br />
<br />
In this folder look for two files:<br />
<br />
LastCrash lastCrashFilename<br />
<br />
If both files are present, delete them, and try restarting Metro Firefox again. After doing this, check the folder again. If the files return, a startup crash is likely.<br />
<br />
There are two things you can do t this point to help diagnose the problem:<br />
<br />
<b>Option 1</b>: Use Desktop Firefox to submit the crash report to Mozilla's crash server -<br />
<br />
* open lastCrashFilename with notepad.exe<br />
* copy the temp path and note the file name of the crash report<br />
* open the temp path in explorer and locate the two files associated with the report.<br />
<br />
There will be two files, both will have the same file name (a uuid string) and the extensions .dmp and .extra.<br />
<br />
* shutdown desktop firefox if it is running<br />
* In explorer, copy both files from their location into the follow folder:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\Firefox\Crash Reports\pending\<br />
<br />
* start Desktop Firefox.<br />
* Navigate to 'about:crashes'.<br />
* find the uuid of the report you copied and click on its link<br />
<br />
If the link does not resolve to a crash server crash report immediately, wait a few minutes and try again. Once the link resolves, file a bug and copy the report's link into the bug report.<br />
<br />
<b>Option 2</b>:<br />
<br />
File a bug and contact a dev. who you can share your crash report with. Note crash reports can contain user specific info, do not submit these files to bugzilla as attachments.<br />
<br />
<b><br />
4) Logging startup<br />
</b><br />
<br />
..<br />
<br />
<b><br />
5) CEH logging<br />
</b><br />
<br />
..<br />
<br />
== Testing Harness ==<br />
<br />
Builds generate a test harness (dist/bin/metrotestharness.exe) that can be used to launch the metro browser into the immersive environment. This harness is also packed up with the test zips used in automation testing.<br />
<br />
Metro Firefox can't accept standard command line parameters since it must be launched by Windows. The harness acts as a pass through for mozilla command line parameters firefox.exe can accept. Incoming params are written out to an ini file @ dist/bin and read in via [http://mxr.mozilla.org/mozilla-central/source/browser/app/nsBrowserApp.cpp nsBrowserApp] when the browser starts up.<br />
<br />
By default the test harness assumes the default browser (firefox.exe) is in the same folder metrotestharness.exe is located. If you want to launch the default browser at a different location from metrotestharness.exe, you must specify a firefox path using -firefoxpath (fullpath):<br />
<br />
<pre>metrotestharness.exe -firefoxpath T:\Mozilla\objmcrel\dist\bin\ -url www.mozilla.org</pre><br />
<br />
The test harness will need *write* permission to this location to write out a command line arg ini file.<br />
<br />
[http://mxr.mozilla.org/mozilla-central/source/browser/metro/shell/testing/metrotestharness.cpp harness source]<br />
<br />
== Using Devtools ==<br />
* Tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=850019<br />
** There are known issues with the profiler. All other parts should be functional, modulo the refactoring work the devtools team is doing on them.<br />
* This hooks into the tools developed & maintained by the devtools team.<br />
* They have been refactoring & improving their tools, so it <strong>highly encouraged</strong> to use Nightly builds on both sides of the pairing if possible.<br />
<br />
* Before you start<br />
** You must have metro installed & working<br />
** You must access to a classic/desktop fx. This need not be a local build<br />
** If you are connecting remotely, you must make sure both machines can ping each other before starting. This will save you a lot of grief later<br />
*** on windows ipconfig in the cmdline is helpful in getting your ip address<br />
*** on windows 8 this usually means disabling the firewall (not encouraged) or adding inbound/outbound firewall rules to allow them to connect.<br />
**** If you need it, Peter in IT now knows a fair bit about setting up those rules if you get lost or stuck.<br />
** If you are on wifi, both devices must be on the same network to communicate. Mozilla != Mozilla-G. <br />
*** It sounds silly but some of the windows devices only see Mozilla-G and the older company issued thinkpads do not have the hardware for it.<br />
<br />
* Setup<br />
** Go to about:config on classic/desktop fx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** Check that these values are what you want<br />
**** devtools.debugger.remote-port -> 6000 (I'd leave this one alone unless you have a compelling reason to change it)<br />
*** If you don't have these, you'll probably want these as well<br />
**** devtools.debugger.log -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
** Restart classic/desktop fx<br />
*** You need to restart for the next step to work.<br />
** Navigate Firefox button -> Web Developer -> "Connect.." entry between the Error Console" & "Get More Tools" Entry<br />
*** https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up is what this step is based on<br />
** Go to about:config on metrofx<br />
*** devtools.debugger.force-local -> false<br />
*** devtools.debugger.remote-enabled -> true<br />
*** and you may want<br />
**** devtools.debugger.log -> true<br />
**** devtools.errorconsole.enabled -> true<br />
**** browser.dom.window.dump.enabled -> true<br />
*** devtools.debugger.remote-port -> 6000 (again I'd leave this one alone)<br />
*** It is unclear if a restart is required. I frequently do in the test-build-dev cycle anyway.<br />
** Make sure metrofx is started (and not suspended)<br />
** In classic fx, click the "Connect..." entry <br />
*** Depending on your version, this will launch a new tab or a new panel on firefox<br />
*** Enter the ip of metrofx if you are connecting remotely and the port number if you've changed them.<br />
*** If you are connecting on a localhost, you shouldn't need to change the default settings.<br />
** Click the connect button in classic fx<br />
** On metrofx a strap(the metro version of the modal dialog) will appear about an incoming connection.<br />
*** Click/tap "allow"<br />
** On classic fx, the connect page will reload with a list of active tabs & processes. Usually 'main process' is the most interesting.<br />
** The devtools console will appear & the aforementioned tab on classic fx will disappear<br />
** Sally forth & debug!<br />
<br />
* Notes<br />
** I usually pair on localhost, using an external monitor so I can see metrofx & classicfx at the same time.<br />
** If you are using localhost without an external monitor, beware of windows suspending the metrofx while its waiting for the incoming connection. This will cause the pairing to fail.<br />
** While you can pair classic/metrofx running out of the same obj dir, I frequently experienced unexpected hangs and crashes as a result.<br />
** if you close the devtools window, this usually results in the metro browser shutting down<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=676960Firefox/Windows 8 Integration2013-07-16T18:48:48Z<p>Anaaktgeboren: </p>
<hr />
<div>== Wiki ==<br />
<br />
* [https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc.<br />
* [[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
* [https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
* [[Windows8|Metro Project Status]] - not really in use.<br />
* [[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 Windows 8 (desktop)]<br />
* [[Firefox/Windows 8 Metro Style Guides]] - coding standards and UI guidelines<br />
<br />
== Useful Bugzilla Queries ==<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;list_id=5745479 Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-1-0=notsubstring;list_id=5756053;field0-1-0=status_whiteboard;field0-0-0=status_whiteboard;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;value0-2-0=MetroV1;value0-1-0=feature%3Dstory;field0-2-0=short_desc;type0-0-0=notsubstring;value0-0-0=feature%3Depic;type0-2-0=notsubstring Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
* Minus feature=story, epic, and MetroV1<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-7-0=notsubstring;value0-7-0=feature%3Ddefect;field0-3-0=status_whiteboard;type0-1-0=notequals;type0-5-0=notsubstring;value0-5-0=feature%3Dwork;value0-4-0=feature%3Dstory;list_id=5745413;field0-1-0=blocked;field0-0-0=blocked;type0-4-0=notsubstring;resolution=---;field0-6-0=status_whiteboard;value0-3-0=feature%3Depic;field0-7-0=status_whiteboard;query_format=advanced;value0-2-0=MetroV1;value0-6-0=feature%3Dchange;value0-1-0=842686;type0-3-0=notsubstring;field0-2-0=short_desc;field0-5-0=status_whiteboard;field0-4-0=status_whiteboard;type0-6-0=notsubstring;type0-0-0=notequals;value0-0-0=841214;type0-2-0=notsubstring;product=Firefox%20for%20Metro Untagged Bugs]<br />
* Not blocked by various pm triage tracking bugs<br />
* Whiteboard does not contain feature=epic, work, change, defect, story<br />
* Summary does not contain 'MetroV1'<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?chfield=%5BBug%20creation%5D;chfieldfrom=-72h;known_name=Last%20Three%20Days;columnlist=opendate%2Cbug_severity%2Cpriority%2Cop_sys%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc;resolution=---;op_sys=Windows%20XP;op_sys=Windows%20Vista;op_sys=Windows%207;op_sys=Windows%208;op_sys=Windows%208%20Metro;query_based_on=Last%20Three%20Days;chfieldto=Now;query_format=advanced;product=Firefox%20for%20Metro;list_id=5745420 Last three days]<br />
<br />
* Bugs filed against product Metro Firefox in the last three days<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform]<br />
<br />
* Core, Toolkit, mozilla.org<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* Style guidelines of all types can be found on https://wiki.mozilla.org/Firefox/Windows_8_Metro_Style_Guides<br />
* the front end code is to be literally a user friendly. it helps developers to get understood easily.<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Nightly Builds ===<br />
<br />
Update: 6/24/2013<br />
<br />
Nightly builds are now being generated on mozilla-central.<br />
<br />
Nightly builds off the mozilla-central repository are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
<br />
For more detailed help on installing / setting the browser as the default, visit the [https://support.mozilla.org/en-US/kb/how-do-i-install-windows-8-metro-style-firefox Metro Firefox support page].<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/topcrasher/byversion/MetroFirefox/22.0a1/7 Firefox for Metro]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To install:<br />
<br />
* Download the newest firefox-(rev).0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe on the desktop<br />
* If prompted by Windows, select Nightly/Aurora/Firefox as the default.<br />
* Open Options -> Advanced -> General and click the "Make Firefox the default browser" button. This will open Windows Control Panel where you will need to select the channel build you are testing and set the defaults.<br />
<br />
=== Building Locally ===<br />
<br />
Updated 5/21/2013<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild] (version 1.7 required)<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
* Install [http://www.microsoft.com/en-us/download/confirmation.aspx?id=6812 DirectX SDK (June 2010)]<br />
<br />
* For VC 2010 builds:<br />
** Modify the the following header in the sdk:<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
If you use both VC 2010 and VC 2012 (or plan to install VC 2012 in the near future) you might want to instead use the following patch, which reverts to the original code under VC 2012 and later:<br />
<pre><br />
--- asyncinfo.h.orig 2013-05-21 08:47:49 -0400<br />
+++ asyncinfo.h 2013-05-21 08:48:55 -0400<br />
@@ -58,17 +58,21 @@<br />
/* interface __MIDL_itf_asyncinfo_0000_0000 */<br />
/* [local] */ <br />
<br />
// Microsoft Windows<br />
// Copyright (c) Microsoft Corporation. All rights reserved.<br />
#pragma once<br />
#ifdef __cplusplus<br />
namespace ABI { namespace Windows { namespace Foundation {<br />
+#if defined (_MSC_VER) && _MSC_VER >= 1700<br />
enum class AsyncStatus {<br />
+#else<br />
+enum AsyncStatus {<br />
+#endif<br />
Started = 0,<br />
Completed, <br />
Canceled, <br />
Error,<br />
};<br />
} } } // ABI::Windows:::Foundation<br />
using ABI::Windows::Foundation::AsyncStatus;<br />
#ifndef _HIDE_GLOBAL_ASYNC_STATUS<br />
</pre><br />
<br />
* For Express versions of VS:<br />
** Install [http://www.microsoft.com/en-us/download/details.aspx?id=11800 the Windows Driver Toolkit, version 1.7] - Version 7.1 is needed because it contains the necessary ATL headers that express VS lacks.<br />
** Add the following to start-msvc*.bat file near the end just before the line that reads cd "%USERPROFILE%" (assumes WinDDK was installed in "C:\WinDDK\7600.16385.1"):<br />
<pre><br />
set "INCLUDE=C:\WinDDK\7600.16385.1\inc\atl71;%INCLUDE%"<br />
set "LIB=C:\WinDDK\7600.16385.1\lib\ATL\i386;%LIB%"<br />
</pre><br />
<br />
* Check out mozilla-central. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* Config and build m-c<br />
<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Firefox/Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
Currently, some of the selection tests may fail (specifically, browser_selection_frame_textarea.js) if the device and CSS pixels are out of sync. To solve this, you may need to change the following pref in about:config to the following value.<br />
<br />
layout.css.devPixelsPerPx = 1.0 (default is -1.0, which makes Firefox autoscale CSS pixels)<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
pymake mochitest-metro-chrome<br />
<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
On Mac, you might need to run "./mach build browser" after your build completes. For details, see {{bug|847807}}.<br />
<br />
* there is a problem with html5 EMBED tag. '''an EMBED tag is basically to play media files.''' but we can't use this on mac.<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that show up in the console. The following environment variable is assumed for the Metro environment:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.sqlite database file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Using your favorite sqlite tool (the [https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ SQLite Manager Add-on] works), find the inspector's entry in the 'addon' table and set the 'active' field to integer 1, and the userDisabled field to integer value 0.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* In Explorer on the tablet purge any unused space on C, including old Windows installation files, using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main disk partition into two. A 20GB partition for mozilla related bits is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your debugging workstation does not use.<br />
* Right-click the new mozilla drive in Explorer and select Share. Share the volume using your login credentials or you can also openly share to "Everyone" if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation browse to the tablet share and map it to a local drive using the same drive letter you used for the tablet drive. This insures object source has the same path info on both machines.<br />
* Install Visual Studio and mozilla-build on the tablet.<br />
* Checkout mozilla-central on the mozilla partition of the tablet, then build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up a remote debug tools folder via search, open this and launch the remote debug monitor. Run the x64 version if on 64 bit os, x86 otherwise. (Pin this to your start menu for easy access.)<br />
* Under the monitor's tools menu, add permission for your login credentials or "Everyone" for remote debugging.<br />
* On the workstation, create a blank C++ debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session. Most debug output the browser spits out should be transferred over to the remote debugger.<br />
<br />
Note you might have to fiddle with access permissions a bit. Opening everything up to Everyone saves a lot of time, but might not be the most secure environment, depending on your situation.<br />
<br />
=== Diagnosing Startup Problems ===<br />
<br />
Due to the embedded nature of metro browsers, diagnosing startup problems can be a bit of a pain. There are a few things you can do to help devs figure out what's going wrong.<br />
<br />
<b><br />
1) Launch the metro browser interface on desktop to confirm the install is working.<br />
</b><br />
<br />
* Navigate to firefox's install location in explorer<br />
* Hold shift, right-click the folder with firefox.exe and select open command prompt.<br />
* in the prompt type 'firefox.exe -metrodesktop'<br />
<br />
The metro front end should launch in a window on the desktop. If not, try uninstalling and re-installing. If that doesn't help, please file a bug.<br />
<br />
<b><br />
2) Check Direct3D start up check results<br />
</b><br />
<br />
Using regedit.exe, check under the following key for a value named 'MetroD3DAvailable':<br />
<br />
HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox<br />
<br />
If the value is 0, Direct3D startup checks failed. Please file a bug, and post the Graphics section of your desktop browser's about:support section to the bug. If there is no value, please file a bug. If the value is 1, startup checks succeeded.<br />
<br />
<b><br />
3) Check for submitted crashes reports<br />
</b><br />
<br />
To check if metro fx is generating and submitting crash reports open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\submitted\<br />
<br />
If the folder exists and contains text files please file a bug and copy the contents of a few of the most recent files into the bug.<br />
<br />
<b><br />
4) Check for unsubmitted crashes reports<br />
</b><br />
<br />
Metro firefox can not submit crashes for analysis unless the browser fully starts ({{bug|797023}}).<br />
<br />
To check if metro fx is crashing on startup, open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\<br />
<br />
In this folder look for two files:<br />
<br />
LastCrash lastCrashFilename<br />
<br />
If both files are present, delete them, and try restarting Metro Firefox again. After doing this, check the folder again. If the files return, a startup crash is likely.<br />
<br />
There are two things you can do t this point to help diagnose the problem:<br />
<br />
<b>Option 1</b>: Use Desktop Firefox to submit the crash report to Mozilla's crash server -<br />
<br />
* open lastCrashFilename with notepad.exe<br />
* copy the temp path and note the file name of the crash report<br />
* open the temp path in explorer and locate the two files associated with the report.<br />
<br />
There will be two files, both will have the same file name (a uuid string) and the extensions .dmp and .extra.<br />
<br />
* shutdown desktop firefox if it is running<br />
* In explorer, copy both files from their location into the follow folder:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\Firefox\Crash Reports\pending\<br />
<br />
* start Desktop Firefox.<br />
* Navigate to 'about:crashes'.<br />
* find the uuid of the report you copied and click on its link<br />
<br />
If the link does not resolve to a crash server crash report immediately, wait a few minutes and try again. Once the link resolves, file a bug and copy the report's link into the bug report.<br />
<br />
<b>Option 2</b>:<br />
<br />
File a bug and contact a dev. who you can share your crash report with. Note crash reports can contain user specific info, do not submit these files to bugzilla as attachments.<br />
<br />
<b><br />
4) Logging startup<br />
</b><br />
<br />
..<br />
<br />
<b><br />
5) CEH logging<br />
</b><br />
<br />
..<br />
<br />
== Testing Harness ==<br />
<br />
Builds generate a test harness (dist/bin/metrotestharness.exe) that can be used to launch the metro browser into the immersive environment. This harness is also packed up with the test zips used in automation testing.<br />
<br />
Metro Firefox can't accept standard command line parameters since it must be launched by Windows. The harness acts as a pass through for mozilla command line parameters firefox.exe can accept. Incoming params are written out to an ini file @ dist/bin and read in via [http://mxr.mozilla.org/mozilla-central/source/browser/app/nsBrowserApp.cpp nsBrowserApp] when the browser starts up.<br />
<br />
By default the test harness assumes the default browser (firefox.exe) is in the same folder metrotestharness.exe is located. If you want to launch the default browser at a different location from metrotestharness.exe, you must specify a firefox path using -firefoxpath (fullpath):<br />
<br />
<pre>metrotestharness.exe -firefoxpath T:\Mozilla\objmcrel\dist\bin\ -url www.mozilla.org</pre><br />
<br />
The test harness will need *write* permission to this location to write out a command line arg ini file.<br />
<br />
[http://mxr.mozilla.org/mozilla-central/source/browser/metro/shell/testing/metrotestharness.cpp harness source]<br />
<br />
== Using Devtools ==<br />
* Tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=850019<br />
* This hooks into the tools developed & maintained by the devtools team.<br />
* They have been refactoring & improving their tools, so it highly encouraged to use Nightly builds on both sides of the pairing if possible.<br />
* Before you start<br />
** You must have metro installed & working<br />
** You must access to a classic/desktop fx. This need not be a local build<br />
** If you are connecting remotely, you must make sure both machines can ping each other before starting. This will save you a lot of grief later<br />
* Setup<br />
* Notes<br />
** I usually pair on localhost, using an external monitor so I can see metrofx & classicfx at the same time.<br />
** If you are using localhost without an external monitor, beware of windows suspending the metrofx while its waiting for the incoming connection. This will cause the pairing to fail.<br />
** While you can pair classic/metrofx running out of the same obj dir, I frequently experienced unexpected hangs and crashes as a result.<br />
** if you close the devtools window, this usually results in the metro browser shutting down<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Metro/WorkWeekII&diff=656842Firefox/Metro/WorkWeekII2013-05-16T20:59:19Z<p>Anaaktgeboren: /* Work Week Results */</p>
<hr />
<div>=May 2013 Metro Work Week=<br />
<br />
==When & Where==<br />
*'''When''': May 13 - 17, 2013<br />
*'''Where''': Mozilla Vancouver Office ([http://people.mozilla.org/~jjensen/files/vancouver_office_tour.mp4 video tour])<br><br />
** 163 West Hastings Street, Vancouver, BC ([http://goo.gl/maps/gBYiS Google Map])<br />
** The Mozilla office is on the second floor. Please buzz in at the front door: '''#209'''<br />
** Floor alarm code is '''0512''' And should be set by the last person out each evening.<br />
*'''Hotel''': [http://www.deltahotels.com/en/hotels/british-columbia/delta-vancouver-suites/ Delta Vancouver Suites] 550 West Hastings St. Vancouver, BC V6B 1L6. Phone 604-689-8188<br />
*''' More information:''' [http://www.weatheroffice.gc.ca/city/pages/bc-74_metric_e.html Weather forecast]<br />
* '''[https://maps.google.com/maps/ms?msid=214431763562665286479.0004ce14fa5a4a16a2e17&msa=0 Shared Google Map]''' with office, hotel, and restaurant locations<br />
<br />
==Food==<br />
* '''Breakfast''': 9:00 AM at Vancouver office<br />
* '''Lunch''': Noon at Vancouver office<br />
* '''Team Dinner''': Reservations have been made at the Irish Heather - 212 Carrall Street, Vancouver, BC V6B 2J2(604)688-9779<br />
<br />
==Objectives==<br />
* Strategies to Improve:<br />
** Team Velocity<br />
** Quality and Defect Levels <br />
* Review and Revise V1 MVP Product Feature Set<br />
** Triage Backlog<br />
** Planning Backlog<br />
** Defect & Change Backlog<br />
** Story Backlog <br />
* Develop Aurora/Beta Release Criteria<br />
<br />
==Agenda==<br />
<br />
===Sunday May 12===<br />
* Travel Day<br />
<br />
===Monday May 13===<br />
<p> </p><br />
* '''Agenda Review and Work Week Objectives'''<br />
<p> </p><br />
* '''State of Production'''<br />
** Development To Date - [https://wiki.mozilla.org/Firefox/Metro#Summary View Project Summary]<br />
** Forecasts - Expected, Best Case and Worst Case: [https://wiki.mozilla.org/Firefox/Metro#Release View Release Forecast]<br />
** Backlogs - Story, Defect & Change, Planning, Triage:<br />
*** Story Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View]<br />
*** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
**** 42 Defects/Changes in total to date.<br />
**** 58 points estimated (128 available in contingency).<br />
**** 22 require point estimations.<br />
*** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
**** 11 items require editing.<br />
*** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
**** 11 items require review.<br />
** Contingency:<br />
*** Scope - 16 points held in reserve.<br />
*** Defect - 128 points held in reserve.<br />
<p> </p><br />
* '''Design Presentation'''<br />
** A presentation from Yuan about Firefox Design Values and 2013 FX UX themes.<br />
** [10:15am - 11am] A vidyo presentation from Bill Selman about Firefox User Types.<br />
<p> </p><br />
* '''Backlog Review & Clearing'''<br />
** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
<br />
===Tuesday May 14===<br />
<p> </p><br />
* '''Team Update Meeting'''<br />
** [https://metro.etherpad.mozilla.org/14 View MoPad]<br />
<p> </p><br />
* '''Scope Planning'''<br />
** Review of P4 and P5 stories to remove from V1 - Asa to lead discussion - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View Story Backlog]<br />
** Review of implemented but not ready for prime time features for remove from V1 - Asa to lead discussion.<br />
** UX Papercuts discussion - Asa to lead gathering of annoyances glitches that we don't have documented already.<br />
<p> </p><br />
* '''Product Development Discussion'''<br />
** Stability issues<br />
** Performance Issues<br />
** User Data<br />
<p> </p> <br />
* '''Debugging Hacks & Demonstrations'''<br />
<p> </p><br />
<br />
===Wednesday May 15===<br />
<p> </p><br />
* '''Production Performance'''<br />
** Velocity Performance<br />
*** Benchmark average up to 10% increase in velocity per iteration.<br />
*** As of Iteration #6, we have averaged a 23% increase per iteration.<br />
*** To be updated at the end of each iteration.<br />
*** Will assist the team to understand when velocity has stabilized and, in turn, when development has completed.<br />
*** Will be used in conjunction with our velocity range calculation to gauge performance.<br />
*** '''Patch Review Idea''' - Try for instant review if you understand the patch right away, otherwise try for same day review, otherwise comment with timeline. Reassign right away if you feel you aren't the best person for the review.<br />
** Quality Performance<br />
*** Of all feature, defect and change stories submitted to QA for testing across all iterations:<br />
**** 89% average pass rate.<br />
**** 11% average fail rate.<br />
**** 80% test coverage. <br />
*** Baseline figures for future performance - to be updated at the end of each iteration.<br />
*** Will assist the team to forecast and prioritize the number of defects up to the release date and determine which ones to transfer to V2.<br />
<p> </p> <br />
* '''Debugging Hacks & Demonstrations'''<br />
<p> </p><br />
* '''Product Release Discussion'''<br />
** Aurora Uplift Criteria<br />
** Beta Uplift Criteria<br />
** Release Management - '''Bhavana Bajaj will join us via Video Conference.'''<br />
*** What iteration are we looking at to sync with the release cycle? Do we have a goal here? Here's the link to Relase Management Calendar to help sync up the dates https://wiki.mozilla.org/RapidRelease/Calendar<br />
**** Current forecast shows Nov 19 as 'expected' uplift to Aurora. Next mc merge after that is Dec. 9th, which puts us in the release channel on March 3rd, 2014.<br />
***** Once the team velocity stabilizes we will be in a better position to pinpoint the merge date.<br />
**** What features remain that we consider critical for an Aurora uplift? How can we move uplift to a more reasonable date (Aug. 5th merge / Oct. 28th release)?<br />
***** The current expected and optimistic release forecasts do not support completion of development in August.<br />
*** We should peek into metrics to get win8 ADI's on nightly(~20,000) ,aurora(<20,000) & beta(~95,000) to see if we are targeting the needed user population and have a strategy around uplift's.<br />
*** Do our updates work fine? We should do a round of update testing on different win8 configurations . We never want to leave user's stranded an old build.<br />
**** QA request, include round of update testing during the merge week when we uplift<br />
*** L10n - How many locales are we planning on supporting ? Do we have a cut-off on this for launch?<br />
*** Stability - Given the limited population on nightly it is hard to get attention or track any new crashers. But once we move up the trains this will change. So we will need more Engineering/QA attention to help resolve these (https://crash-stats.mozilla.com/products/MetroFirefox)<br />
*** Get query of blockers ready to help track right bugs (metro-aurora-blockers, metro-beta-blockers).<br />
*** Branding concerns ?<br />
<p> </p> <br />
* '''Debugging Hacks & Demonstrations'''<br />
<p> </p><br />
<br />
===Thursday May 16===<br />
<p> </p><br />
* '''Team Discussion Points'''<br />
** Automation Planning<br />
*** I understand that there is a multi-team group getting together to tackle this in the first week of June.<br />
*** What can we do to help them hit that ground running?<br />
*** Who's the point person from our group on this?<br />
** Maximizing Developer Hours<br />
*** How long is too long to find new work?<br />
*** How can we identify 'shovel-ready' bugs faster?<br />
** Who owns stories when the work bugs have many owners?<br />
** IRC Status Update - frequency has declined.<br />
*** Need to be maintained on a daily basis.<br />
*** More specific references to iteration work (Bug ID). <br />
** Final Iteration #7 Team Update<br />
<p> </p> <br />
* '''Debugging Hacks & Demonstrations'''<br />
<p> </p><br />
<br />
===Friday May 17===<br />
<p> </p><br />
* Travel Day<br />
<br />
==Work Week Results==<br />
<p> </p><br />
'''Triage Backlog'''<br />
* 6 items removed from V1 release.<br />
<p> </p><br />
'''Planning Backlog'''<br />
* 2 Feature Stories moved to Story Backlog ready for upcoming iterations.<br />
<p> </p><br />
'''Defect & Change Backlog'''<br />
* 4 Defect Stories removed from V1 release.<br />
* 31 of 38 Defect/Change Stories prioritized from P1 - P5.<br />
<p> </p><br />
'''Story Backlog'''<br />
* 9 P4 and P5 Feature Stories removed from V1 release.<br />
* 2 P4 and P5 Feature Stories promoted to P3 priority status.<br />
<p> </p><br />
'''Scope Contingency'''<br />
* Feature Story removals replenished our Scope Contingency from 16 to 77 points.<br />
<p> </p><br />
'''Strategies for Improving Team Velocity:'''<br />
# If a bug is actionable, mark it [shovel-ready] in the whiteboard. Others may feel free to steal these, so if youre actively working on it, clear the flag.<br />
## Also be sure to mark mentored bugs<br />
# Only work on what you can reproduce, if someone else can reproduce it then transfer the work to them as quickly as possible. <br />
# If you know how to fix a bug, dump the information in it to save other people time.<br />
# If you're trying to fix a bug in an iteration and you're having trouble, transfer it back to the Story Backlog and let someone else pick it up on a later iteration. Don't be afraid to re-assign to someone else. Substitute with a bug you feel more confident in.<br />
# Faster reviews, review it right away if you know what it is, take a day at most or warn that it'll take longer.<br />
# Developers will use their discretion to determine if a defect found during iteration testing is a P4 or P5 priority status. Those that are will not be considered to block the feature story and it can be resolved.<br />
<p> </p><br />
'''Strategies for Improving Test Coverage:'''<br />
# Each team member will participate in release testing on release planning day of the iteration (day 11) to assist the QA department in achieving a 100% test coverage.<br />
# Metro will work with QA and Release Management to organize regular 'Metro Test Days' to gather community testers.<br />
# Faster reviews, review it right away if you know what it is, take a day at most or warn that it'll take longer. This will help us identify and resolve defects quicker before the end of an iteration.<br />
<p> </p><br />
'''Aurora/Beta Release Criteria'''<br />
* Metro will prepare to land on Aurora in order to take advantage of the larger testing population.<br />
* Metro '''will not''' ride trains until development is complete.<br />
* Select features will be updated on Aurora to garner further user feedback.<br />
* Plans in progress to uplift to Aurora at the end of June.</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Metro/WorkWeekII&diff=654131Firefox/Metro/WorkWeekII2013-05-09T19:16:41Z<p>Anaaktgeboren: /* Thursday May 16 */</p>
<hr />
<div>=May 2013 Metro Work Week=<br />
<br />
==When & Where==<br />
*'''When''': May 13 - 17, 2013<br />
*'''Where''': Mozilla Vancouver Office ([http://people.mozilla.org/~jjensen/files/vancouver_office_tour.mp4 video tour])<br><br />
** 163 West Hastings Street, Vancouver, BC ([http://goo.gl/maps/gBYiS Google Map])<br />
** The Mozilla office is on the second floor. Please buzz in at the front door: '''#209'''<br />
** Floor alarm code is '''0512''' And should be set by the last person out each evening.<br />
*'''Hotel''': [http://www.deltahotels.com/en/hotels/british-columbia/delta-vancouver-suites/ Delta Vancouver Suites] 550 West Hastings St. Vancouver, BC V6B 1L6. Phone 604-689-8188<br />
*''' More information:''' [http://www.weatheroffice.gc.ca/city/pages/bc-74_metric_e.html Weather forecast]<br />
* '''[https://maps.google.com/maps/ms?msid=214431763562665286479.0004ce14fa5a4a16a2e17&msa=0 Shared Google Map]''' with office, hotel, and restaurant locations<br />
<br />
==Food==<br />
* '''Breakfast''': 9:00 AM at Vancouver office<br />
* '''Lunch''': Noon at Vancouver office<br />
* '''Team Dinner''': Reservations have been made at the Irish Heather - 212 Carrall Street, Vancouver, BC V6B 2J2(604)688-9779<br />
<br />
==Objectives==<br />
* Strategies to Improve:<br />
** Team Velocity <br />
*** '''IDEA:''' Try for instant review if you understand the patch right away, otherwise try for same day review, otherwise comment with timeline. Reassign right away if you feel you aren't the best person for the review. <br />
* Maximizing developer hours<br />
** How long is too long to find new work?<br />
** How can we identify 'shovel-ready' bugs faster?<br />
* Who owns stories when the work bugs have many owners? <br />
** Quality & Defect Levels<br />
* Review and Revise Project Release Schedule: [https://wiki.mozilla.org/Firefox/Metro#Release View Current Release Schedule] <br />
* Review and Revise V1 MVP Product Feature Set: [https://bugzilla.mozilla.org/show_bug.cgi?id=838081 View Current V1 Story Backlog] <br />
* Develop Aurora/Beta Release Criteria<br />
<br />
==Agenda==<br />
<br />
===Sunday May 12===<br />
* Travel Day<br />
<br />
===Monday May 13===<br />
<p> </p><br />
* '''Agenda Review and Work Week Objectives'''<br />
<p> </p><br />
* '''Regular Monday Team Meeting'''<br />
** [https://metro.etherpad.mozilla.org/14 View May 13 MoPad]<br />
<p> </p><br />
* '''State of Production''' - [https://wiki.mozilla.org/Firefox/Metro#Summary View Project Summary]<br />
** Iterations - Current and Previously Completed: [https://wiki.mozilla.org/Firefox/Metro#Iterations View Iteration List]<br />
** Forecasts - Expected, Best Case and Worst Case: [https://wiki.mozilla.org/Firefox/Metro#Release View Release Forecast]<br />
** Backlogs - Story, Defect & Change, Planning, Triage:<br />
*** Story Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View]<br />
*** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
*** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
*** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
<p> </p><br />
* '''Design Presentation'''<br />
** A presentation from Yuan about Firefox Design Values and 2013 FX UX themes.<br />
** [10:15am - 11am] A vidyo presentation from Bill Selman about Firefox User Types.<br />
<p> </p><br />
* '''Backlog Review & Clearing'''<br />
** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
** Contingency:<br />
*** Scope - [https://bugzilla.mozilla.org/show_bug.cgi?id=831564 View]<br />
*** Defect - [https://bugzilla.mozilla.org/show_bug.cgi?id=831545 View]<br />
<br />
===Tuesday May 14===<br />
<p> </p><br />
* '''Scope Planning'''<br />
** Review of P4 and P5 stories to remove from V1 - Asa to lead discussion - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View Story Backlog]<br />
** Review of implemented but not ready for prime time features for remove from V1 - Asa to lead discussion.<br />
** UX Papercuts discussion - Asa to lead gathering of annoyances glitches that we don't have documented already.<br />
<p> </p><br />
* '''Production Performance'''<br />
** Feature Completeness<br />
*** 33 Open Defects/Changes<br />
**** 20 - Iterations #1 - #6<br />
**** 10 - Legacy Features<br />
**** 3 - To Be Allocated<br />
*** 28% of all features are incomplete.<br />
*** Baseline figure for future performance.<br />
*** To be updated at the end of each iteration.<br />
** Velocity Performance<br />
*** Benchmark is average 10% increase in velocity per iteration.<br />
*** As of Iteration #6, we have averaged a 23% increase per iteration.<br />
*** Performance will be updated at the conclusion of each iteration.<br />
*** To be updated at the end of each iteration.<br />
** Quality Performance<br />
*** Of all feature, defect and change stories submitted to QA for testing across all iterations:<br />
**** 89% average pass rate.<br />
**** 11% average fail rate.<br />
**** 80% test coverage. <br />
*** Baseline figures for future performance.<br />
*** To be updated at the end of each iteration.<br />
<p> </p><br />
* '''Product Development Discussion'''<br />
** Stability issues<br />
** Performance Issues<br />
** User Data<br />
<br />
===Wednesday May 15===<br />
<p> </p><br />
* '''Product Release Discussion'''<br />
** Aurora Uplift Criteria<br />
** Beta Uplift Criteria<br />
** Current forecast shows Nov 19 as 'expected' uplift to Aurora. Next mc merge after that is Dec. 9th, which puts us in the release channel on March 3rd, 2014.<br />
** What features remain that we consider critical for an Aurora uplift? How can we move uplift to a more reasonable date (Aug. 5th merge / Oct. 28th release)?<br />
** Release Management - '''Bhavana Bajaj will join us via Video Conference.'''<br />
*** What iteration are we looking at to sync with the release cycle? Do we have a goal here? Here's the link to Relase Management Calendar to help sync up the dates https://wiki.mozilla.org/RapidRelease/Calendar<br />
*** We should peek into metrics to get win8 ADI's on nightly(~20,000) ,aurora(<20,000) & beta(~95,000) to see if we are targeting the needed user population and have a strategy around uplift's.<br />
*** Do our updates work fine? We should do a round of update testing on different win8 configurations . We never want to leave user's stranded an old build.<br />
*** L10n - How many locales are we planning on supporting ? Do we have a cut-off on this for launch?<br />
*** Stability - Given the limited population on nightly it is hard to get attention or track any new crashers. But once we move up the trains this will change. So we will need more Engineering/QA attention to help resolve these (https://crash-stats.mozilla.com/products/MetroFirefox)<br />
*** Get query of blockers ready to help track right bugs (metro-aurora-blockers, metro-beta-blockers).<br />
*** Branding concerns ?<br />
<br />
===Thursday May 16===<br />
<p> </p><br />
* Automation Planning?<br />
** I understand that there is a multi-team group getting together to tackle this in the first week of June.<br />
** What can we do to help them hit that ground running?<br />
** Who's the point person from our group on this?<br />
* Debugging Hacks & Demonstrations - Development Team<br />
<br />
===Friday May 17===<br />
<p> </p><br />
* Travel Day</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Metro/WorkWeekII&diff=654130Firefox/Metro/WorkWeekII2013-05-09T19:14:59Z<p>Anaaktgeboren: /* Objectives */</p>
<hr />
<div>=May 2013 Metro Work Week=<br />
<br />
==When & Where==<br />
*'''When''': May 13 - 17, 2013<br />
*'''Where''': Mozilla Vancouver Office ([http://people.mozilla.org/~jjensen/files/vancouver_office_tour.mp4 video tour])<br><br />
** 163 West Hastings Street, Vancouver, BC ([http://goo.gl/maps/gBYiS Google Map])<br />
** The Mozilla office is on the second floor. Please buzz in at the front door: '''#209'''<br />
** Floor alarm code is '''0512''' And should be set by the last person out each evening.<br />
*'''Hotel''': [http://www.deltahotels.com/en/hotels/british-columbia/delta-vancouver-suites/ Delta Vancouver Suites] 550 West Hastings St. Vancouver, BC V6B 1L6. Phone 604-689-8188<br />
*''' More information:''' [http://www.weatheroffice.gc.ca/city/pages/bc-74_metric_e.html Weather forecast]<br />
* '''[https://maps.google.com/maps/ms?msid=214431763562665286479.0004ce14fa5a4a16a2e17&msa=0 Shared Google Map]''' with office, hotel, and restaurant locations<br />
<br />
==Food==<br />
* '''Breakfast''': 9:00 AM at Vancouver office<br />
* '''Lunch''': Noon at Vancouver office<br />
* '''Team Dinner''': Reservations have been made at the Irish Heather - 212 Carrall Street, Vancouver, BC V6B 2J2(604)688-9779<br />
<br />
==Objectives==<br />
* Strategies to Improve:<br />
** Team Velocity <br />
*** '''IDEA:''' Try for instant review if you understand the patch right away, otherwise try for same day review, otherwise comment with timeline. Reassign right away if you feel you aren't the best person for the review. <br />
* Maximizing developer hours<br />
** How long is too long to find new work?<br />
** How can we identify 'shovel-ready' bugs faster?<br />
* Who owns stories when the work bugs have many owners? <br />
** Quality & Defect Levels<br />
* Review and Revise Project Release Schedule: [https://wiki.mozilla.org/Firefox/Metro#Release View Current Release Schedule] <br />
* Review and Revise V1 MVP Product Feature Set: [https://bugzilla.mozilla.org/show_bug.cgi?id=838081 View Current V1 Story Backlog] <br />
* Develop Aurora/Beta Release Criteria<br />
<br />
==Agenda==<br />
<br />
===Sunday May 12===<br />
* Travel Day<br />
<br />
===Monday May 13===<br />
<p> </p><br />
* '''Agenda Review and Work Week Objectives'''<br />
<p> </p><br />
* '''Regular Monday Team Meeting'''<br />
** [https://metro.etherpad.mozilla.org/14 View May 13 MoPad]<br />
<p> </p><br />
* '''State of Production''' - [https://wiki.mozilla.org/Firefox/Metro#Summary View Project Summary]<br />
** Iterations - Current and Previously Completed: [https://wiki.mozilla.org/Firefox/Metro#Iterations View Iteration List]<br />
** Forecasts - Expected, Best Case and Worst Case: [https://wiki.mozilla.org/Firefox/Metro#Release View Release Forecast]<br />
** Backlogs - Story, Defect & Change, Planning, Triage:<br />
*** Story Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View]<br />
*** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
*** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
*** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
<p> </p><br />
* '''Design Presentation'''<br />
** A presentation from Yuan about Firefox Design Values and 2013 FX UX themes.<br />
** [10:15am - 11am] A vidyo presentation from Bill Selman about Firefox User Types.<br />
<p> </p><br />
* '''Backlog Review & Clearing'''<br />
** Defect & Change Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=867657%2C867515%2C861853%2C861883%2C864241%2C859418%2C867884%2C867525%2C867499%2C867502%2C868217%2C867523%2C861891%2C861568%2C855691%2C857813%2C860248%2C869237%2C869175%2C867929%2C867641%2C865093%2C858594%2C860788%2C854072%2C858388%2C867495%2C857437%2C859681%2C864247%2C857862%2C865356%2C858184%2C862162%2C865519%2C856283%2C859629%2C831086%2C861901%2C856264%2C861885%2C865369&list_id=6492024 View]<br />
** Planning Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=833153%2C823541%2C783232%2C837293%2C869603%2C849380%2C831910%2C866304%2C864457%2C833155%2C852263&list_id=6492025 View]<br />
** Triage Backlog - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=861525%2C843236%2C851165%2C855663%2C867708%2C839342%2C856244%2C856712%2C866572%2C860039%2C859625&list_id=6492026 View]<br />
** Contingency:<br />
*** Scope - [https://bugzilla.mozilla.org/show_bug.cgi?id=831564 View]<br />
*** Defect - [https://bugzilla.mozilla.org/show_bug.cgi?id=831545 View]<br />
<br />
===Tuesday May 14===<br />
<p> </p><br />
* '''Scope Planning'''<br />
** Review of P4 and P5 stories to remove from V1 - Asa to lead discussion - [https://bugzilla.mozilla.org/buglist.cgi?bug_id=849396%2C831943%2C801154%2C855294%2C831984%2C855935%2C831610%2C844642%2C831981%2C855930%2C845152%2C831944%2C855927%2C850630%2C831986%2C792576%2C833192%2C791706%2C775718%2C867616%2C849266%2C855932%2C831920%2C855928%2C831972%2C865714%2C855938%2C775739%2C831942%2C855434%2C869940%2C855937%2C834656%2C855311%2C855926%2C773817%2C855934%2C831931%2C855945%2C831924%2C855931%2C831613%2C837766%2C867754&list_id=6492023 View Story Backlog]<br />
** Review of implemented but not ready for prime time features for remove from V1 - Asa to lead discussion.<br />
** UX Papercuts discussion - Asa to lead gathering of annoyances glitches that we don't have documented already.<br />
<p> </p><br />
* '''Production Performance'''<br />
** Feature Completeness<br />
*** 33 Open Defects/Changes<br />
**** 20 - Iterations #1 - #6<br />
**** 10 - Legacy Features<br />
**** 3 - To Be Allocated<br />
*** 28% of all features are incomplete.<br />
*** Baseline figure for future performance.<br />
*** To be updated at the end of each iteration.<br />
** Velocity Performance<br />
*** Benchmark is average 10% increase in velocity per iteration.<br />
*** As of Iteration #6, we have averaged a 23% increase per iteration.<br />
*** Performance will be updated at the conclusion of each iteration.<br />
*** To be updated at the end of each iteration.<br />
** Quality Performance<br />
*** Of all feature, defect and change stories submitted to QA for testing across all iterations:<br />
**** 89% average pass rate.<br />
**** 11% average fail rate.<br />
**** 80% test coverage. <br />
*** Baseline figures for future performance.<br />
*** To be updated at the end of each iteration.<br />
<p> </p><br />
* '''Product Development Discussion'''<br />
** Stability issues<br />
** Performance Issues<br />
** User Data<br />
<br />
===Wednesday May 15===<br />
<p> </p><br />
* '''Product Release Discussion'''<br />
** Aurora Uplift Criteria<br />
** Beta Uplift Criteria<br />
** Current forecast shows Nov 19 as 'expected' uplift to Aurora. Next mc merge after that is Dec. 9th, which puts us in the release channel on March 3rd, 2014.<br />
** What features remain that we consider critical for an Aurora uplift? How can we move uplift to a more reasonable date (Aug. 5th merge / Oct. 28th release)?<br />
** Release Management - '''Bhavana Bajaj will join us via Video Conference.'''<br />
*** What iteration are we looking at to sync with the release cycle? Do we have a goal here? Here's the link to Relase Management Calendar to help sync up the dates https://wiki.mozilla.org/RapidRelease/Calendar<br />
*** We should peek into metrics to get win8 ADI's on nightly(~20,000) ,aurora(<20,000) & beta(~95,000) to see if we are targeting the needed user population and have a strategy around uplift's.<br />
*** Do our updates work fine? We should do a round of update testing on different win8 configurations . We never want to leave user's stranded an old build.<br />
*** L10n - How many locales are we planning on supporting ? Do we have a cut-off on this for launch?<br />
*** Stability - Given the limited population on nightly it is hard to get attention or track any new crashers. But once we move up the trains this will change. So we will need more Engineering/QA attention to help resolve these (https://crash-stats.mozilla.com/products/MetroFirefox)<br />
*** Get query of blockers ready to help track right bugs (metro-aurora-blockers, metro-beta-blockers).<br />
*** Branding concerns ?<br />
<br />
===Thursday May 16===<br />
<p> </p><br />
* Debugging Hacks & Demonstrations - Development Team<br />
<br />
===Friday May 17===<br />
<p> </p><br />
* Travel Day</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Metro_Style_Guides&diff=608079Firefox/Windows 8 Metro Style Guides2013-03-13T00:05:55Z<p>Anaaktgeboren: /* JS */</p>
<hr />
<div>= Nota Bene =<br />
* this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will help us produce a consistent, shiny produce faster. If you have questions about this page, please ping :ally in #windev.<br />
<br />
= Design/Theming guidelines =<br />
* use flyout panes over dialogs<br />
= Coding Guidelines =<br />
* Generally we use [https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style Mozilla Coding Style], with a few exceptions:<br />
** You don't need to wrap lines to 80 characters. Use longer lines (up to around 120 characters; use your judgement) if it improves readability.<br />
* Consistency is king, and supersedes any particular rule.<br />
== JS ==<br />
* Coding Style exceptions:<br />
** Put the opening brace on the same line as the "function" keyword (rather than on a separate line by itself).<br />
* https://developer.mozilla.org/en-US/docs/JavaScript_Tips<br />
<br />
== CSS ==<br />
* if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.<br />
= helpful references =<br />
* yuan's list of design links: https://kippt.com/yuan/designing-for-windows-8<br />
* general coding guidelines for mozilla: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Metro_Style_Guides&diff=608077Firefox/Windows 8 Metro Style Guides2013-03-13T00:00:56Z<p>Anaaktgeboren: </p>
<hr />
<div>= Nota Bene =<br />
* this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will help us produce a consistent, shiny produce faster. If you have questions about this page, please ping :ally in #windev.<br />
<br />
= Design/Theming guidelines =<br />
* use flyout panes over dialogs<br />
= Coding Guidelines =<br />
* Generally we use [https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style Mozilla Coding Style], with a few exceptions:<br />
* You don't need to wrap lines to 80 characters. Use longer lines (up to around 120 characters; use your judgement) if it improves readability.<br />
* Consistency is king, and supersedes any particular rule.<br />
== JS ==<br />
* else in if/else pairings are double cuddled ( eg } else {<br />
== CSS ==<br />
* if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.<br />
= helpful references =<br />
* yuan's list of design links: https://kippt.com/yuan/designing-for-windows-8<br />
* general coding guidelines for mozilla: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Metro_Style_Guides&diff=608076Firefox/Windows 8 Metro Style Guides2013-03-12T23:59:52Z<p>Anaaktgeboren: </p>
<hr />
<div>= Nota Bene =<br />
* this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will help us produce a consistent, shiny produce faster. If you have questions about this page, please ping :ally in #windev.<br />
<br />
* Design/Theming guidelines<br />
** use flyout panes over dialogs<br />
* Coding Guidelines<br />
** Generally we use [https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style Mozilla Coding Style], with a few exceptions:<br />
*** You don't need to wrap lines to 80 characters. Use longer lines (up to around 120 characters; use your judgement) if it improves readability.<br />
* Consistency is king, and supersedes any particular rule.<br />
** JS<br />
*** else in if/else pairings are double cuddled ( eg } else {<br />
** CSS<br />
*** if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.<br />
* helpful references<br />
** yuan's list of design links: https://kippt.com/yuan/designing-for-windows-8<br />
* general coding guidelines for mozilla: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=608069Firefox/Windows 8 Integration2013-03-12T23:49:55Z<p>Anaaktgeboren: </p>
<hr />
<div>== Wiki ==<br />
<br />
* [https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc.<br />
* [[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
* [https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
* [[Windows8|Metro Project Status]] - not really in use.<br />
* [[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 Windows 8 (desktop)]<br />
<br />
== Useful Bugzilla Queries ==<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;list_id=5745479 Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-1-0=notsubstring;list_id=5756053;field0-1-0=status_whiteboard;field0-0-0=status_whiteboard;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;value0-2-0=MetroV1;value0-1-0=feature%3Dstory;field0-2-0=short_desc;type0-0-0=notsubstring;value0-0-0=feature%3Depic;type0-2-0=notsubstring Win8 Metro]<br />
<br />
* Metro Firefox complete list<br />
* Minus feature=story, epic, and MetroV1<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?type0-7-0=notsubstring;value0-7-0=feature%3Ddefect;field0-3-0=status_whiteboard;type0-1-0=notequals;type0-5-0=notsubstring;value0-5-0=feature%3Dwork;value0-4-0=feature%3Dstory;list_id=5745413;field0-1-0=blocked;field0-0-0=blocked;type0-4-0=notsubstring;resolution=---;field0-6-0=status_whiteboard;value0-3-0=feature%3Depic;field0-7-0=status_whiteboard;query_format=advanced;value0-2-0=MetroV1;value0-6-0=feature%3Dchange;value0-1-0=842686;type0-3-0=notsubstring;field0-2-0=short_desc;field0-5-0=status_whiteboard;field0-4-0=status_whiteboard;type0-6-0=notsubstring;type0-0-0=notequals;value0-0-0=841214;type0-2-0=notsubstring;product=Firefox%20for%20Metro Untagged Bugs]<br />
* Not blocked by various pm triage tracking bugs<br />
* Whiteboard does not contain feature=epic, work, change, defect, story<br />
* Summary does not contain 'MetroV1'<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?chfield=%5BBug%20creation%5D;chfieldfrom=-72h;known_name=Last%20Three%20Days;columnlist=opendate%2Cbug_severity%2Cpriority%2Cop_sys%2Cassigned_to%2Cbug_status%2Cresolution%2Cshort_desc;resolution=---;op_sys=Windows%20XP;op_sys=Windows%20Vista;op_sys=Windows%207;op_sys=Windows%208;op_sys=Windows%208%20Metro;query_based_on=Last%20Three%20Days;chfieldto=Now;query_format=advanced;product=Firefox%20for%20Metro;list_id=5745420 Last three days]<br />
<br />
* Bugs filed against product Metro Firefox in the last three days<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform]<br />
<br />
* Core, Toolkit, mozilla.org<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* You can find Windows 8 front end bugs here http://goo.gl/YQZiy or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Firefox, Component = General<br />
* Style guidelines of all types can be found on https://wiki.mozilla.org/Firefox/Windows_8_Metro_Style_Guides<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++, C++/CX<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Nightly Builds ===<br />
<br />
Update: 2/19/2013<br />
<br />
Nightly builds are now being generated on mozilla-central.<br />
<br />
Nightly builds off the mozilla-central repository are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
For the time being, <strong>only the desktop browser can do browser updates</strong> to new builds ({{bug|794936}}, {{bug|794937}}). If prompted to update, make sure to shut the metro browser down first to allow the update to complete.<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/query/query?product=MetroFirefox&version=ALL%3AALL&do_query=1&range_value=2&range_unit=weeks Previous two weeks]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/ builder archives]. Note these are not nightlies, they do not self update. To install:<br />
<br />
* Download the newest firefox-(rev).0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe<br />
* Set Metro Firefox as the default browser through Firefox preferences, which launches Control Panel -> Default Programs<br />
<br />
=== Building Locally ===<br />
<br />
Updated 10/31/2012<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild]<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
* If you are using an express version of VS, install [http://www.microsoft.com/en-us/download/details.aspx?id=11800 the windows driver toolkit] - Don't install WDK 8, version 7.1 is needed because it contains the necessary ATL headers that express VS lacks. Then, add the following to start-msvc*.bat file (assuming it was installed on "C:\WinDDK\7600.16385.1"):<br />
<pre><br />
set "INCLUDE=%INCLUDE%;C:\WinDDK\7600.16385.1\inc\atl71"<br />
set "LIB=%LIB%;C:\WinDDK\7600.16385.1\lib\ATL\i386"<br />
</pre><br />
<br />
: For VS 2010/8.0 SDK builds, update to the latest start-msvc2010 batch script from [https://hg.mozilla.org/mozilla-build/summary mozilla-build repo].<br />
: For VS2012 builds, use the current start-msvc2011 batch scripts distributed with MozillaBuild.<br />
<br />
* Modify the the following header in the sdk:<br />
<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
* Check out mozilla-central. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* Config and build m-c<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Firefox/Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
pymake mochitest-metro-chrome<br />
<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that pop up. Because they appear on the desktop and block the UI, they will make the Metro UI appear to hang until you dismiss them on the desktop. You can set the following environment variable to ensure that they're logged rather than displayed as popups:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
Set up steps:<br />
<br />
* From the start screen, type "control panel"<br />
* Search for "Environment"<br />
* Click "Edit environment variables for your account"<br />
* Add the user variable "XPCOM_DEBUG_BREAK" with value "warn"<br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.sqlite database file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Using your favorite sqlite tool (the [https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ SQLite Manager Add-on] works), find the inspector's entry in the 'addon' table and set the 'active' field to integer 1, and the userDisabled field to integer value 0.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* Install Win8 on the tablet, use the same login/password you use on the workstation you'll be debugging from.<br />
* From Explorer purge any unused space on C, including old Windows installation files using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main partition into two. A 80GB/20GB split is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your main workstation doesn't use.<br />
* Right-click the new drive in Explorer and select Share. Share this volume for your login credentials, you can also openly share it to everyone if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation, map the tablet share to a local drive. Use the same drive letter for both the tablet drive and the mapped workstation drive. This insures object source has the same path info.<br />
* Checkout Elm on the second drive of the tablet, build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise.<br />
* On the workstation, create a debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session.<br />
<br />
=== Diagnosing Startup Problems ===<br />
<br />
Due to the embedded nature of metro browsers, diagnosing startup problems can be a bit of a pain. There are a few things you can do to help devs figure out what's going wrong.<br />
<br />
<b><br />
1) Launch the metro browser interface on desktop to confirm the install is working.<br />
</b><br />
<br />
* Navigate to firefox's install location in explorer<br />
* Hold shift, right-click the folder with firefox.exe and select open command prompt.<br />
* in the prompt type 'firefox.exe -metrodesktop'<br />
<br />
The metro front end should launch in a window on the desktop. If not, try uninstalling and re-installing. If that doesn't help, please file a bug.<br />
<br />
<b><br />
2) Check Direct3D start up check results<br />
</b><br />
<br />
Using regedit.exe, check under the following key for a value named 'MetroD3DAvailable':<br />
<br />
HKEY_CURRENT_USER\SOFTWARE\Mozilla\Firefox<br />
<br />
If the value is 0, Direct3D startup checks failed. Please file a bug, and post the Graphics section of your desktop browser's about:support section to the bug. If there is no value, please file a bug. If the value is 1, startup checks succeeded.<br />
<br />
<b><br />
3) Check for submitted crashes reports<br />
</b><br />
<br />
To check if metro fx is generating and submitting crash reports open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\submitted\<br />
<br />
If the folder exists and contains text files please file a bug and copy the contents of a few of the most recent files into the bug.<br />
<br />
<b><br />
4) Check for unsubmitted crashes reports<br />
</b><br />
<br />
Metro firefox can not submit crashes for analysis unless the browser fully starts ({{bug|797023}}).<br />
<br />
To check if metro fx is crashing on startup, open explorer to the following path:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\MetroFirefox\Crash Reports\<br />
<br />
In this folder look for two files:<br />
<br />
LastCrash lastCrashFilename<br />
<br />
If both files are present, delete them, and try restarting Metro Firefox again. After doing this, check the folder again. If the files return, a startup crash is likely.<br />
<br />
There are two things you can do t this point to help diagnose the problem:<br />
<br />
<b>Option 1</b>: Use Desktop Firefox to submit the crash report to Mozilla's crash server -<br />
<br />
* open lastCrashFilename with notepad.exe<br />
* copy the temp path and note the file name of the crash report<br />
* open the temp path in explorer and locate the two files associated with the report.<br />
<br />
There will be two files, both will have the same file name (a uuid string) and the extensions .dmp and .extra.<br />
<br />
* shutdown desktop firefox if it is running<br />
* In explorer, copy both files from their location into the follow folder:<br />
<br />
C:\Users\(youraccount)\AppData\Roaming\Mozilla\Firefox\Crash Reports\pending\<br />
<br />
* start Desktop Firefox.<br />
* Navigate to 'about:crashes'.<br />
* find the uuid of the report you copied and click on its link<br />
<br />
If the link does not resolve to a crash server crash report immediately, wait a few minutes and try again. Once the link resolves, file a bug and copy the report's link into the bug report.<br />
<br />
<b>Option 2</b>:<br />
<br />
File a bug and contact a dev. who you can share your crash report with. Note crash reports can contain user specific info, do not submit these files to bugzilla as attachments.<br />
<br />
<b><br />
4) Logging startup<br />
</b><br />
<br />
..<br />
<br />
<b><br />
5) CEH logging<br />
</b><br />
<br />
..<br />
<br />
== Hardware ==<br />
<br />
[https://docs.google.com/spreadsheet/ccc?key=0AowtJTCuyojddHpMeDV5czhDMkU0bFBKTktQLUhkbnc Asa's Google Docs list of Win8 touch friendly hardware]<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Metro_Style_Guides&diff=608064Firefox/Windows 8 Metro Style Guides2013-03-12T23:46:33Z<p>Anaaktgeboren: Created page with "* Nota Bene ** this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will ..."</p>
<hr />
<div>* Nota Bene<br />
** this a spot to jot down guidelines of varying types, largely for front end developers & designers. This includes code style, theming style, and whatever else will help us produce a consistent, shiny produce faster. If you have questions about this page, please ping :ally in #windev.<br />
<br />
* Design/Theming guidelines<br />
** use flyout panes over dialogs<br />
* Coding Guidelines<br />
* Consistency is king, and supersedes any particular rule.<br />
** JS<br />
*** else in if/else pairings are double cuddled ( eg } else {<br />
** CSS<br />
*** if you create an attribute and it has only one value, do not set it to true/false. Remove the attribute in the case of false. This produces cleaner, more concise css, without imperiling js readability.<br />
* helpful references<br />
** yuan's list of design links: https://kippt.com/yuan/designing-for-windows-8<br />
* general coding guidelines for mozilla: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/Windows_8_Integration&diff=520702Firefox/Windows 8 Integration2013-02-15T19:33:53Z<p>Anaaktgeboren: /* DOM Inspector */</p>
<hr />
<div>== Wiki ==<br />
<br />
[https://wiki.mozilla.org/Firefox/Metro Metro Project] - meeting times, bug lists, project goals, team info, etc. <br />
<br />
[[Firefox/Features|General Firefox Product Feature Tracking]] - Firefox feature tracking.<br />
<br />
[https://wiki.mozilla.org/Firefox_Metro_UI Firefox Metro UI wiki] - including comp work and UX bug tracking.<br />
<br />
[[Windows8|Metro Project Status]] - not really in use.<br />
<br />
[[Windows_8_Integration]] - General 3rd party browser collaboration page dedicated to overview, architecture, and challenges for vendors. Early research with Google.<br />
<br />
== Desktop Development ==<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208;query_format=advanced;list_id=2566504 General Windows 8 bug list]<br />
<br />
== Metro Development ==<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?status_whiteboard_type=notregexp;query_format=advancedresolution=---;op_sys=Windows%208%20Metro;list_id=3868779 Bug List] - all open "Windows 8 Metro" bugs<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;resolution=---;op_sys=Windows%208%20Metro;list_id=3868779 Bug List] - all open "Windows 8 Metro" bugs minus 'completed-elm' white board tag<br />
<br />
=== General Platform Integration ===<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;product=Core;product=Toolkit;product=www.mozilla.org Platform Bug List] - Core, Toolkit, mozilla.org<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4351876;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;product=Core;product=Toolkit;product=www.mozilla.org Platform Bug List] - Core, Toolkit, mozilla.org minus 'completed-elm'<br />
<br />
=== General Front End ===<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4638979;resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;product=Firefox;product=Firefox%20for%20Metro Front End Buglist]<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?list_id=4188841;resolution=---;op_sys=Windows%208%20Metro;status_whiteboard_type=notregexp;query_format=advanced;status_whiteboard=completed-elm;product=Firefox;product=Firefox%20for%20Metro Front End Buglist] - minus 'completed-elm'<br />
<br />
=== Q3 Firefox Goals ===<br />
<br />
[https://bugzilla.mozilla.org/buglist.cgi?quicksearch=sw%3Ametro-preview%20-sw%3Acompleted-elm;list_id=4454405 Tagged Bug List] - metro-preview tagged bugs minus completed-elm.<br />
<br />
End of September: "Implement Firefox Metro UI preview: This preview will include primary browser UI for navigation and tabs and will be delivered as a combined classic+metro browser."<br />
<br />
Important platform / build bugs:<br />
<br />
* <strike>{{bug|755724}}</strike> - split dist/bin resources bug<br />
* <strike>{{bug|737833}}</strike> - basic installer work on elm<br />
* <strike>{{bug|779902}}</strike> - enable nightly metro builds on elm<br />
* <strike>{{bug|782451}}</strike> - copy/paste fails for winrt backend<br />
* <strike>{{bug|787786}}</strike> - UA string<br />
* <strike>{{bug|771238}} / {{bug|785750}}</strike> - file picker freeze<br />
<br />
=== Q4 Firefox Goals ===<br />
<br />
* WinRT vc10 backport / Merge to mc<br />
* TSF / Soft keyboard contexts<br />
* OMTC / Pinch and Zoom<br />
* Suspend / resume handling<br />
* Local Sync<br />
* Dual-mode scrollbars<br />
* Immersive automated test support w/infrastructure<br />
<br />
=== Q1 Firefox Goals ===<br />
<br />
* Flash interop<br />
* Accessibility / UIA interop<br />
*<br />
<br />
=== Sync specific ===<br />
<br />
TBD - new plan based on recent Sync meetings. Need to update this.<br />
<br />
Relying on the Sync service for syncing the metro profile with a default desktop profile presents various issues:<br />
<br />
* simple sync setup - setting up a new sync account in both browsers is problematic. Device pairing will be troublesome between metro/desktop due to suspend issues. Potentially the installer could be used to do initial setup for both browsers. We could also use a local connection or the registry to populate sync account info in both browsers.<br />
* interprocess communication - when flipping back and forth between metro and the desktop, running instances need to know when they need to sync. {{bug|769424}}<br />
* interprocess identification - the metro browser should communicate it's sync account id when signaling the default desktop browser to sync. {{bug|769424}}<br />
* browser startup - AFAICT from testing, Firefox is configured to sync any new data on delayed startup, then recheck every 90 seconds. Need to confirm metrofx does the same. Assuming this is the default, missed interprocess events shouldn't be an issue.<br />
* smarter interprocess signaling - when signaling another browser the signalee should be aware of whether data was actually updated before triggering events. {{bug|770298}}<br />
* Sync service load - syncing regularly between two browsers will add considerable load on the sync service. TBD how serious this is and whether or not sync 2.0 apis can alleviate the problem.<br />
* network reliance - we would like to avoid this down the road in some TBD way. The current test implementation using the Sync 1.0 service relies on the computer being connected to a network. {{bug|768638}}<br />
* local sync -<br />
** one possible solution would be to add support for importing/exporting changesets over a specific time period. Two clients using the same account could then share changesets rather than hitting the network. Data would be transmitted as json between processes. For security purposes clients would only import data associated with the same account (w/a check before the eval), and data should be obfuscated.<br />
** another solution would be to use a local sync server run by one browser. How would this integrate with the networked sync service?<br />
* mirroring - is there data that doesn't get mirrored between two clients? (deleting a bookmark for example) Mirroring between metrofx and the desktop browser should to be strict both browser should feel as if they are sharing the same profile.<br />
* Sync 1.0 or 2.0 - the sync team has expressed the need for the use of sync 2.0 apis for metro integration. ETA of development.<br />
<br />
[https://etherpad.mozilla.org/metro-sync Sync Team etherpad]<br />
<br />
=== Plugin specific ===<br />
<br />
* Flash: [https://github.com/mozilla/shumway Shumway]<br />
* PDF: {{bug|771250}}<br />
* General plugin support bug: {{bug|738600}}<br />
<br />
=== Tests specific ===<br />
<br />
Metro browser chrome tests can be run using 'make mochitest-metro-chrome' in the top level of the objdir, or './mach mochitest-metro' in the top level of the source repository.<br />
<br />
Rel-Eng related tracking bugs for Win8 Classic and Metro work:<br />
<br />
<bugzilla><br />
{<br />
"id": "754399,731280"<br />
}<br />
</bugzilla><br />
<br />
Metro testing:<br />
<br />
<bugzilla><br />
{<br />
"id": "771271,759905,773817"<br />
}<br />
</bugzilla><br />
<br />
=== Accessibility specific ===<br />
<br />
<bugzilla><br />
{<br />
"id": "778493,762769, 741750"<br />
}<br />
</bugzilla><br />
<br />
[https://wiki.mozilla.org/Accessibility Accessibility Team wiki]<br><br />
{{bug|648121}} - Accessibility telemetry tracking bug<br />
<br />
== Getting Involved ==<br />
Contact Brian Bondy with questions (bbondy on [http://irc.mozilla.org IRC]). The Windows 8 integration team can be found in in #windev.<br />
<br />
=== Bugzilla ===<br />
<br />
Please file front end bugs under the product [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Metro Firefox for Metro]. Back end bugs should be filed in the appropriate Platform component.<br />
<br />
=== Front End Windows 8 Development ===<br />
<br />
* To contribute to front end bugs, you will use: JS, CSS, XUL, XBL<br />
* You do not actually need Windows 8 to work on the front end code<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The front end code is located in browser/metro<br />
* You can find Windows 8 front end bugs here http://goo.gl/YQZiy or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Firefox, Component = General<br />
<br />
=== Platform Integration Windows 8 Development ===<br />
<br />
* To contribute to platform integration bugs, you will use: C++, C++/CX<br />
* You do need Windows 8 to work on the platform integration code<br />
* You can obtain a 90 day free Windows 8 evaluation for developers from Microsoft<br />
* Follow the steps in the Metro Builds section below to get setup<br />
* The platform integration code is located in widget/windows/winrt<br />
* You can find Windows 8 platform integration bugs here http://goo.gl/B0Xjo or by doing an advanced bugzilla search for: OS = Windows 8 Metro, Product = Core, Component = Widget: Win32<br />
<br />
== Metro Builds ==<br />
<br />
=== Elm Nightly Builds ===<br />
<br />
Nightly builds off the Elm repository where metro development is taking place are currently available in the [http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-elm/ Firefox build archives].<br />
<br />
To set these builds up:<br />
<br />
* Install the browser using the latest installer<br />
* Open the desktop browser - when the default browser check occurs, select yes to set Firefox as the default. You should also receive a Windows prompt, select Nightly. This will associate Firefox with various protocol handlers and create the Firefox tile.<br />
* To set file handler associations use Window's Control Panel for default program associations. (Options -> Advanced -> General and click the default browser button at the bottom to open this panel.) <br />
<br />
For the time being, <strong>only the desktop browser can do browser updates</strong> to new builds ({{bug|794936}}, {{bug|794937}}). If prompted to update, make sure to shut the metro browser down first to allow the update to complete.<br />
<br />
=== Nightly Crash Reports ===<br />
<br />
[https://crash-stats.mozilla.com/query/query?product=MetroFirefox&version=ALL%3AALL&do_query=1&range_value=2&range_unit=weeks Previous two weeks]<br />
<br />
=== Switching Default Browsers ===<br />
<br />
This can be a little tedious when working with multiple builds / installs on a single device. Steps:<br />
<br />
* Close Firefox both in Metro and on Desktop<br />
* Open Control Panel's default programs and set IE as the default<br />
* With debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* In Control Panel's default programs, set firefox as the default browser.<br />
<br />
To confirm the right browser is set, launch the browser in Metro, switch to desktop, open task manager, right-click the Firefox process, and select open file location.<br />
<br />
Note pinned taskbar shortcuts can't be trusted to open the right browser.<br />
<br />
=== Elm Zip Builds ===<br />
<br />
Zip installs from daily checkins are currently available on the [http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/elm-win32-metro/ metro builder archives]. Note these are not nightlies, they do not self update. To install:<br />
<br />
* Download the newest firefox-18.0a1.en-US.win32.zip to your Win8 device<br />
* Unpack the main firefox folder to a suitable location<br />
* Run firefox.exe<br />
* Set Metro Firefox as the default browser through Firefox preferences, which launches Control Panel -> Default Programs<br />
<br />
==== Elm Symbols ====<br />
<br />
(Obsolete - dep build symbols no longer uploaded. Use Nightly builds for debugging w/symbols.)<br />
<br />
Win8 Metro builders <strong>do not</strong> upload dep build symbols to the symbol server. However they do upload full symbol packages to the [http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/elm-win32-metro/ metro builder archives]. For debugging zip builds using pdbs, download the full symbols package, unzip to a suitable folder, and unpack the pdbs using the shell command below in the root of the folder. Then add this folder location to the debugging -> symbols paths in Visual Studio under the Tools menu.<br />
<br />
<pre>find . -name "*.pd_" | while read FILENAME; do expand -r $FILENAME; done</pre><br />
<br />
=== Building Locally ===<br />
<br />
Updated 10/31/2012<br />
<br />
* Install Visual Studio 2010 or 2012.<br />
* Install [https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites MozillaBuild]<br />
* Install the [http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx Windows 8.0 SDK]<br />
<br />
: For VS 2010/8.0 SDK builds, update to the latest start-msvc2010 batch script from [https://hg.mozilla.org/mozilla-build/summary mozilla-build repo].<br />
: For VS2012 builds, use the current start-msvc2011 batch scripts distributed with MozillaBuild.<br />
<br />
* Modify the the following header in the sdk:<br />
<br />
<pre><br />
C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\asyncinfo.h<br />
<br />
line 67:<br />
<br />
enum class AsyncStatus {<br />
<br />
to<br />
<br />
enum /*class*/ AsyncStatus {<br />
</pre><br />
<br />
* Check out Elm. Make sure the obj directory has "Modify" permissions given to the current user.<br />
* Create a standard browser .mozconfig file with the options you prefer and add<br />
<br />
<pre><br />
ac_add_options --enable-metro<br />
</pre><br />
<br />
* Config and build Elm<br />
<br />
At this point, you should be able to launch the metro browser on the desktop using a command line switch:<br />
<br />
<pre><br />
(obj)/dist/bin/firefox.exe -metrodesktop<br />
</pre><br />
<br />
To register local builds as the default browser:<br />
<br />
* For debug builds: run the resulting firefox.exe on the desktop and set as the default through Options menu -> Advanced -> General tab -> Make default button.<br />
* For release builds: run the resulting firefox.exe on the desktop and click yes to the default settings dialog, then select 'Nightly' in the Windows 8 prompt.<br />
* Open up Control Panel -> Default Programs. You should see 'Metro Firefox' in the list of applications.<br />
* Set all Metro Firefox defaults in Default Programs.<br />
<br />
At which point you should have a Firefox tile in Win8 that launches the browser.<br />
<br />
Note, for debug builds, see [[Windows_8_Integration#Logging_Assertions]].<br />
<br />
=== Desktop Launch ===<br />
<br />
To launch within the metro experience follow the registration steps above. To launch the metro front end UI using the win32 widget backend on the desktop (including non-Windows-8 devices) use the -metrodesktop command line option:<br />
<br />
<pre>(path to firefox build)/firefox.exe -metrodesktop</pre><br />
<br />
To set things up such that you can test touch input on the desktop - flip the 'metro.debug.treatmouseastouch' to true in /browser/metro/profile/metro.js.<br />
<br />
Note on the desktop we use the desktop's Win32/Widget backend. This can behave differently from the Win8 WinRT backend. The translational layer for Win32 events is location in /browser/metro/content/base/input.js.<br />
<br />
=== Testing ===<br />
<br />
[https://developer.mozilla.org/en-US/docs/Browser_chrome_tests Browser-chrome tests] for Metro Firefox are located in [http://hg.mozilla.org/projects/elm/file/default/browser/metro/base/tests/ browser/metro/base/tests]. The tests run in the Metro environment; Windows 8 is required.<br />
<br />
To start the tests, run the following command in the mozilla-build shell, at the top level of your obj-dir:<br />
<br />
make mochitest-metro-chrome<br />
<br />
The Metro browser will launch, run the tests and exit. Any failures will be printed to the console. The complete test log will be written to the file <code>mochitest-metro-chrome.log</code> in the objdir.<br />
<br />
=== Building on Linux or Mac OS X ===<br />
<br />
You can use the ''--enable-metro'' configure option and the ''-metrodesktop'' command-line flag to build and run the Metro UI on other platforms too. For details, see [http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html Metro Firefox without Windows 8].<br />
<br />
=== Logging Assertions ===<br />
<br />
When you're running Metro Firefox with --enable-debug, there will be assertion failure messages that pop up. Because they appear on the desktop and block the UI, they will make the Metro UI appear to hang until you dismiss them on the desktop. You can set the following environment variable to ensure that they're logged rather than displayed as popups:<br />
<br />
<pre><br />
XPCOM_DEBUG_BREAK=warn<br />
</pre><br />
<br />
Set up steps:<br />
<br />
* From the start screen, type "advanced settings"<br />
* Open View Advanced System Settings<br />
* Click the "Environment Variables" button<br />
* Add the user variable "XPCOM_DEBUG_BREAK" with value "warn"<br />
<br />
=== Remote Debug Output ===<br />
<br />
NSPR logging can be dumped to OutputDebugString using the NSPR_LOG_FILE environment variable:<br />
<br />
<pre><br />
NSPR_LOG_FILE=WinDebug<br />
</pre><br />
<br />
To log NS assertions and warnings in debug builds add the nsDebug log module:<br />
<br />
<pre><br />
NSPR_LOG_MODULES=nsDebug:4<br />
</pre><br />
<br />
<strike>{{bug|762519}}</strike> was filed on getting javascript's dump output going to OutputDebugString as well.<br />
<br />
=== DOM Inspector ===<br />
<br />
Getting DOM Inspector attached to builds running on the desktop takes a few tweaks. <br />
* Install the dom inspector addon (if you do not have it already) on your desktop firefox<br />
* Copy the 'inspector@mozilla.org' folder under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory. (Example: C:\Users\Brian\AppData\Roaming\Mozilla\MetroFirefox\Profiles\amrcb8eg.default\extensions)<br />
* add an entry in inspector's install.rdf file for metrofx and make sure the maxVersion is set correctly.<br />
<br />
<pre><br />
<em:targetApplication><br />
<Description><br />
<em:id>{99bceaaa-e3c6-48c1-b981-ef9b46b67d60}</em:id><br />
<em:minVersion>1.0a1</em:minVersion><br />
<em:maxVersion>19.0a1</em:maxVersion><br />
</Description><br />
</em:targetApplication><br />
</pre><br />
<br />
* Add the [https://developer.mozilla.org/en/XULRunner_tips startDOMi function] to /browser/metro/base/content/browser.js.<br />
* Add a call to startDOMi() below the BrowserUI.init() call.<br />
* Tweak the following extension prefs in metro.js:<br />
<pre><br />
pref("extensions.autoDisableScopes", 15);<br />
pref("extensions.minCompatibleAppVersion", "4.0");<br />
pref("extensions.strictCompatibility", false);<br />
</pre><br />
<br />
* The extensions.sqlite database file will be created the first time MetroFirefox is run and discovers the inspector@mozilla.org extension content in the profile, but you have to flip a couple of values to make it actually work. Using your favorite sqlite tool (the [https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/ SQLite Manager Add-on] works), find the inspector's entry in the 'addon' table and set the 'active' field to integer 1, and the userDisabled field to integer value 0.<br />
<br />
=== Venkman Debugger ===<br />
<br />
(10/5/12 - Note, since we've changed the app id, this probably doesn't work.)<br />
<br />
* Copy the '{f13b157f-b174-47e7-a34d-4815ddfdfeb8}' xpi under your Firefox profile's extension directory over to your MetroFirefox profile extensions directory.<br />
<br />
* Launch the browser with the '-venkman' command line option.<br />
<br />
=== JS Shell ===<br />
<br />
For debugging the ede js shell and javascript console are available on the app bar in desktop builds.<br />
<br />
=== WinRT Compiler Generated Code ===<br />
<br />
Compiler switches:<br />
* /d1ZWtokens - dump C++ code generated code for C++/CX. <br />
* /d1reportAllClassLayout - dump class layouts<br />
* /d1reportSingleClassLayoutXXX - where XXX performs substring matches against the class name.<br />
<br />
=== Remote Debugging with a VM ===<br />
<br />
(This was last tested with the Win8 RP)<br />
<br />
Setup steps -<br />
<br />
* create a new drive for vm, clone src there, build. obj dir should also be on this drive.<br />
* Enable sharing on the drive, set permissions to full access<br />
* On workstation, map vm share to a local drive. Use the same drive letter for both the vm drive and the mapped workstation drive!<br />
* config vm’s metro firefox as the default Metro browser<br />
* on vm, start – ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise<br />
* start remote debugger on vm<br />
* create empty remote debugging project on workstation<br />
* in project set debug settings:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: vm network name w/ port<br />
** Attach: Yes<br />
* Launch browser in vm<br />
* F5 in project on workstation<br />
<br />
That should be it. OutputDebugString output will land in the workstation debugger console. Breaking in the debugger doesn't kill the browser as long as metro is active and the browser is running in the foreground.<br />
<br />
Note – AFAICT, you can’t reverse the relationship here. Metro will not launch a default browser located on a mapped drive that points to an obj dir on workstation. If we could fine a way around this it would be great.<br />
<br />
=== Remote Debugging with a Tablet ===<br />
<br />
Setup steps -<br />
<br />
* Install Win8 on the tablet, use the same login/password you use on the workstation you'll be debugging from.<br />
* From Explorer purge any unused space on C, including old Windows installation files using the system file cleanup option under the drive's properties panel.<br />
* From Control Panel, bring up the disk manager and split the main partition into two. A 80GB/20GB split is suitable.<br />
* Format the second partition and designate a drive letter for it. Use a drive letter your main workstation doesn't use.<br />
* Right-click the new drive in Explorer and select Share. Share this volume for your login credentials, you can also openly share it to everyone if your local network is secure. Set permissions on the share to full access.<br />
* On your main workstation, map the tablet share to a local drive. Use the same drive letter for both the tablet drive and the mapped workstation drive. This insures object source has the same path info.<br />
* Checkout Elm on the second drive of the tablet, build and register the browser.<br />
* On the tablet, Start + ‘debug’ should bring up remote debug tools folder – run the x64 version if on 64 bit os, x86 otherwise.<br />
* On the workstation, create a debugging project for the tablet, set debug settings as follows:<br />
** Remote command: (common letter drive):\(path to obj dir)\dist\bin\firefox.exe<br />
** Working dir – same<br />
** Remove Server Name: Tablet network name w/ port. The remote debugging tools window on the tablet can provide this.<br />
** Attach: Yes<br />
<br />
After this you should be able to launch the browser on the tablet and attach to it from Visual Studio on your workstation. You should also be able to browse source on the networked drive, set break points, etc., just like a local debug session.<br />
<br />
== Hardware ==<br />
<br />
[https://docs.google.com/spreadsheet/ccc?key=0AowtJTCuyojddHpMeDV5czhDMkU0bFBKTktQLUhkbnc Asa's Google Docs list of Win8 touch friendly hardware]<br />
<br />
== Samsung Series 7 ==<br />
<br />
The Series seven is the first device we started developing with. Details below on getting the hardware set up with Windows 8.<br />
<br />
* To order, file a bug under mozilla.org, Server Operations: Desktop Issues. See {{bug|738613}}, CC your PM or Asa.<br />
<br />
* Once you have the tablet, dock, and keyboard, unpack. Charge up the device. It'll be running Win7, ignore all the default software.<br />
<br />
* Download the 64-bit (3.6 gig) Win8 ISO from \\fs2\IT\Microsoft. Add your name to the list of people who will need product keys in {{bug|783811}}. Burn the ISO to a suitable memory stick. For burning on Windows you'll need to download and install the [http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool Windows 7 USB DVD Download Tool] from Microsoft. For burning on mac?<br />
<br />
* Once you have the ISO burned, plug the USB stick into the tablet's dock. Browse to the USB drive and run "setup.exe". When prompted choose that you want to save nothing from the previous install.<br />
<br />
* Samsung provides an instruction manual on hooking up the Bluetooth keyboard. You can do this after you've installed Win8 as the Win7 desktop instructions are applicable on Win8 desktop.<br />
<br />
* After the tablet is set up, download Firefox nightly or build a local copy and start debugging!<br />
<br />
=== Firmware Updates ===<br />
<br />
For more precise touch input, especially with tap and hold, install the "Touch Screen Sensor Firmware Configuration Updater Tool". Updating the system bios from 7 to 10 doesn't hurt either. Make sure to reboot the system after the install.<br />
<br />
[http://www.samsung.com/global/windowspreview/ Samsung Link]<br />
<br />
=== Samsung Series 7 Tweaks ===<br />
<br />
* To fix auto changing brightness problems for wipe Win8 installs:<br />
** Open desktop<br />
** click/tap on the battery icon in the taskbar, select "More power options"<br />
** Select your current power plan or create a new plan via the link on the left.<br />
** Under the power plan select "Change advanced power settings"<br />
** scroll down to "Display" and expand<br />
** Find the sub-option "Enable adaptive brightness" and expand<br />
** disable both options under this sub-option<br />
<br />
== Metro Planning ==<br />
<br />
(Older content from the original planning stage)<br />
<br />
This is summary of our work / planning for a Win8 Metro browser. For testing purposes we have been working with the /mobile/xul Fennec browser. Moving forward we would like to take the base Fennec XUL code and Metro specific code we've already developed (currently on Elm with some build related work already on mc) and integrate this in with the default Firefox build and install. <br />
<br />
We are interested in getting as much feedback as possible from stake holders and from people who have worked with these newer platforms. If you have Win8 up and running in a vm or on a test system, there are details here on how to get builds going, how to register the browser, and test builds for installing.<br />
<br />
* [https://bugzilla.mozilla.org/buglist.cgi?resolution=---;op_sys=Windows%208%20Metro;query_format=advanced;list_id=2566518 Metro specific bug list]<br />
* [http://piercedotzler.com/asa/Developing_a_Metro-Style_Enabled_Desktop_Browser.html#_Toc318127097 Developing Metro Style Enabled Desktop Browsers]<br />
<br />
=== What’s different and what’s the same ===<br />
<br />
By in large platform was a nice fit for Metro. We ran into surprisingly few problems. It took us about a week to get a basic version of Fennec running in the environment and most of that time was spent combing through the registration/integration doc Microsoft sent us. Below are some specific details on the areas of the repo we are currently leveraging.<br />
<br />
<strong>nsBrowserApp</strong><br />
<br />
<strike>Currently using fennec’s nsBrowserApp.</strike><br />
<br />
<strong>chrome interface markup and css</strong> (different)<br />
<br />
Metro apps are single window applications. The current desktop UI does not fit this new environment. There are no secondary windows we create. Secondary UI (file pickers, warnings, message boxes, toasts) are all displayed and managed by the os. The interfaces to these features are also async. We will provide interfaces for invoking these. Some have already been integrated on Elm (file picker for example).<br />
<br />
<strong>browser comps</strong> (different)<br />
<br />
<strong>dictionaries, hyphenation, res, searchplugins, extensions, plugins</strong> (shared)<br />
<br />
Due to the differences in view model most of /browser components code can’t be leveraged. Fennec's script based components are currently in use. [http://mxr.mozilla.org/mozilla-central/source/mobile/xul/components/]<br />
<br />
The current metro browser leverages the Fennec front end app code but we could switch to firefox’s code base and enable / augment what we need for metro.<br />
<br />
<strong>toolkit/xre</strong> (modest differences)<br />
<br />
The app model is slightly different for Metro. UI events and rendering do not occur on the main thread. We have a working model implemented on Elm that breaks up parts of XRE_main so that certain parts (startup & run) can be called on a different ‘main’ thread. <br />
<br />
<strong>widget</strong> (mostly shared widget/windows code base with different nsIWidget classes)<br />
<br />
There are significant differences in the view model so we needed a new nsWindow class. nsWindow latches into a new set of apis for events and view management. [http://mxr.mozilla.org/projects-central/source/elm/widget/windows/winrt/] Generally winrt and winapi code has integrated well together. We are currently leveraging [http://msdn.microsoft.com/en-us/library/windows/apps/hh755822(v=vs.110).aspx Component Extensions] and various winrt runtime classes. We will be able to share a great deal of win32 widget code.<br />
<br />
<strong>default browser integration</strong> (new registration / launch characteristics for both desktop and metro for win8, older os remains unchanged)<br />
<br />
<strong>installer/helper/uninstall</strong> (shared codebase w/new registration for win8)<br />
<br />
On Windows8 the mechanics of launching the browser have changed. There is a new intermediary (a ‘command execute handler’) which is a small, light weight COM server Windows launches. This application chooses which browser to launch based on the environment requested. This change effects the launch of both browsers and the way we register as the default browser on Windows 8. [http://mxr.mozilla.org/projects-central/source/elm/mobile/xul/metro/] We currently have a basic Fennec install going for testing purposes, but it shouldn’t be too hard to move this over to the Firefox installer.<br />
<br />
<strong>everything else in runtime</strong> (shared)<br />
<br />
Generally we’re currently leveraging a majority of our common code base without issue. Threading, timers, networking, ssl, layout, gfx, etc. have all fit in really well. Misc. detail - <br />
<br />
* gfx - not currently using accelerated layers but plan to in the near future. The surface rendered to in Metro is D2D and there is no GDI fallback. As such there are some issues with blacklisted hardware.<br />
* e10s - currently using Fennec’s out of process tabs.<br />
* Accessibility - not integrated yet.<br />
* Netwerk - no issues.<br />
* Layout - no issues.<br />
* dom & dom/system & hal - DOM interfaces for device info / sensor input and events. Currently there isn't much here for Windows.<br />
* media - no issues.<br />
* storage - works, although there are some profile corruption problems from early termination which can occur in metro. We also have a 'shared profile' problem (see Big Issues).<br />
* toolkit - very little of this is in use. Crash reporter UI will need work/integration.<br />
* xpcom - no issues.<br />
<br />
=== A tentative proposal ===<br />
<br />
* Copy mobile/xul code down to browser level in /browser/metro.<br />
* Integrate metro startup into firefox's nsBrowserApp {{bug|747347}}. <br />
* Integrate building this new area into the current desktop firefox build. {{bug|747347}} <br />
* Fixup the firefox installer so that we bring both browsers down in a single unified windows install. {{bug|737833}}<br />
* Share the runtime between the two apps in the install. <strong>[completed]</strong><br />
* Have nsBrowserApp communicate to xul lib what environment we are running in. <strong>[completed]</strong><br />
* Dynamically switch out which code path we want in xul lib where necessary. <strong>[completed]</strong><br />
* Organize dist interface code and browser comps such that desktop firefox install layout remains unchanged. Layer metro specific resources down in such a way that the two sets of resources do not conflict. {{bug|755724}}<br />
* <strike>Share a single profile between both browsers</strike> or Sync two profiles on the same machine.<br />
<br />
Elm to mozilla-central migration tracking bug: {{bug|747347}}<br />
<br />
==== Pros and Cons ====<br />
<br />
* Pro – single unified Windows installer / unified browser build.<br />
* Pro – shared runtime without multiple copies of key files like xul.dll.<br />
<br />
* Con – larger Windows install regardless of what version of the os we install on. metrobrowser would be present on all Windows installs. <br />
* Con – builders / release eng. will have to upgrade to VC11 / Win8 SDK to do the build. For the time being however we have a build switch that enables win8 specific components, so we can start landing on mc without breaking existing desktop builds which leverage vc10 build tools. {{bug|737994}}<br />
<br />
* Pro/Con – With this setup we currently assume we will leverage xul lib. On the positive side having xul makes putting together our UI fast and easy. On the negative side startup performance may be an issue. We are working on getting telemetry data going so we can better measure this in the test builds we are distributing. Thus far test builds we have going on Samsung tablets and a few other test machines show promise on startup performance. Windows is obviously optimized for loading our libraries and the browsers we compete against all have the same encumbrance.<br />
<br />
=== Big Issues ===<br />
<br />
* Windows XP - The current VC11 Beta redist runtime is not compatible with XP. ({{bug|744942}})<br />
* Profiles – Certain areas of the user’s profile will need to be shared between two concurrently running browser apps. We’ve just begun exploring ways to do this. Potential solution might involve a mysql database connection shim that leverages a profile broker and IPC so both browsers can talk to the same profile. We also might consider using Sync. There are some hurdles here to overcome. <strong>[A decision was made to use Sync initially.]</strong><br />
* Accessibility - This area of the code base will be in heavy use in the Metro environment with touch interfaces. Our accessibility code will require performance work and may require a new UI Automation adapter since Win8 leverages UI Automation exclusively.<br />
* e10s - (khuey) Certain things are pretty much broken in e10s (e.g. IndexedDB) and other features have not received any testing in several months. Relying on e10s will likely require some investment in the platform to clean this up for metro/desktop parity. Not relying on e10s may decrease the amount of existing XUL Fennec code that can be reused. [question: (jimm) what's the difference in the amount of work we have to do? We've disabled remote tabs on elm for now to see what's broken.] <strong>[A decision was made to use in-process content for the foreseeable future.]</strong><br />
* Extensions - currently extension support will be off until a suitable extension mechanism can be designed and implemented.<br />
<br />
== Links ==<br />
<br />
* [http://msdn.microsoft.com/en-us/library/windows/apps/br211369%28v=VS.85%29.aspx API for Metro style apps]<br />
* [http://www.pcworld.com/article/240125/windows_8_on_arm_processors_three_working_tablet_demos.html ARM support]</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=478985User:Anaaktgeboren/MetroFirefox2012-10-11T21:11:00Z<p>Anaaktgeboren: /* Why */</p>
<hr />
<div>= Why =<br />
<br />
* Metro on windows will be big with the launch of windows 8<br />
* 'fast & fluid & fun to use' <br />
* the "touch first firefox'<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* have its own product catagory<br />
** note that installer and certain other bugs are filed elsewhere<br />
** when searching make sure to search for the os as well as the component<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
** clone from http://hg.mozilla.org/projects/elm/<br />
** make sure to add "ac_add_options --enable-metro" to .mozconfig<br />
* build faster!<br />
** ./build/pymake/make.py -f client.mk<br />
** soon to be mach (waiting on merge from m-c)<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI<br />
* ms has some great documentation floating around<br />
** developer guide: http://msdn.microsoft.com/en-us/windows/apps/hh852650<br />
** js focused articles: http://msdn.microsoft.com/en-us/library/windows/apps/hh770842<br />
** pile of presentations: http://www.microsoft.com/en-us/download/details.aspx?id=29854<br />
** js code samples: http://code.msdn.microsoft.com/windowsapps/site/search?f[0].Type=ProgrammingLanguage&f[0].Value=JavaScript&f[0].Text=JavaScript</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=478905User:Anaaktgeboren/MetroFirefox2012-10-11T18:17:13Z<p>Anaaktgeboren: /* Where are the bugs? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* have its own product catagory<br />
** note that installer and certain other bugs are filed elsewhere<br />
** when searching make sure to search for the os as well as the component<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
** clone from http://hg.mozilla.org/projects/elm/<br />
** make sure to add "ac_add_options --enable-metro" to .mozconfig<br />
* build faster!<br />
** ./build/pymake/make.py -f client.mk<br />
** soon to be mach (waiting on merge from m-c)<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI<br />
* ms has some great documentation floating around<br />
** developer guide: http://msdn.microsoft.com/en-us/windows/apps/hh852650<br />
** js focused articles: http://msdn.microsoft.com/en-us/library/windows/apps/hh770842<br />
** pile of presentations: http://www.microsoft.com/en-us/download/details.aspx?id=29854<br />
** js code samples: http://code.msdn.microsoft.com/windowsapps/site/search?f[0].Type=ProgrammingLanguage&f[0].Value=JavaScript&f[0].Text=JavaScript</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=478015User:Anaaktgeboren/MetroFirefox2012-10-10T00:02:18Z<p>Anaaktgeboren: /* Reference */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
** clone from http://hg.mozilla.org/projects/elm/<br />
** make sure to add "ac_add_options --enable-metro" to .mozconfig<br />
* build faster!<br />
** ./build/pymake/make.py -f client.mk<br />
** soon to be mach (waiting on merge from m-c)<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI<br />
* ms has some great documentation floating around<br />
** developer guide: http://msdn.microsoft.com/en-us/windows/apps/hh852650<br />
** js focused articles: http://msdn.microsoft.com/en-us/library/windows/apps/hh770842<br />
** pile of presentations: http://www.microsoft.com/en-us/download/details.aspx?id=29854<br />
** js code samples: http://code.msdn.microsoft.com/windowsapps/site/search?f[0].Type=ProgrammingLanguage&f[0].Value=JavaScript&f[0].Text=JavaScript</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=477933User:Anaaktgeboren/MetroFirefox2012-10-09T20:14:55Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
** clone from http://hg.mozilla.org/projects/elm/<br />
** make sure to add "ac_add_options --enable-metro" to .mozconfig<br />
* build faster!<br />
** ./build/pymake/make.py -f client.mk<br />
** soon to be mach (waiting on merge from m-c)<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=477406User:Anaaktgeboren/MetroFirefox2012-10-08T20:35:18Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
** clone from http://hg.mozilla.org/projects/elm/<br />
* build faster!<br />
** ./build/pymake/make.py -f client.mk<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=477341User:Anaaktgeboren/MetroFirefox2012-10-08T17:49:13Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
** VS 2012 == mvcs 11. No, it does not make any sense<br />
** make sure to grab the VC install from the mozilla servers<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=477337User:Anaaktgeboren/MetroFirefox2012-10-08T17:32:43Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* https://wiki.mozilla.org/Firefox/Windows_8_Integration#Building_Locally<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=477336User:Anaaktgeboren/MetroFirefox2012-10-08T17:32:19Z<p>Anaaktgeboren: /* Team of awesome */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend, loan from Platform)<br />
* fryn (front end)<br />
* ally (front end, loan from Services Integration)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476323User:Anaaktgeboren/MetroFirefox2012-10-03T21:03:48Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
** currently busted on mac: see bug 797533<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476321User:Anaaktgeboren/MetroFirefox2012-10-03T21:03:04Z<p>Anaaktgeboren: /* Team of awesome */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* timeA (backend)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476184User:Anaaktgeboren/MetroFirefox2012-10-03T18:20:14Z<p>Anaaktgeboren: /* Day to day Affairs & Meetings */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused: jimm vidyo room<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476182User:Anaaktgeboren/MetroFirefox2012-10-03T18:17:44Z<p>Anaaktgeboren: /* 1.0 Shipping Requirements */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
* burn down list TBD<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476180User:Anaaktgeboren/MetroFirefox2012-10-03T18:16:57Z<p>Anaaktgeboren: /* What do I need to build it? */</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* mac or linux? http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
* what hardware is recommended for testing?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended.<br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/MetroFirefox&diff=476179User:Anaaktgeboren/MetroFirefox2012-10-03T18:15:55Z<p>Anaaktgeboren: Created page with "= Why = * Metro on windows will be big with the launch of windows 8 * Being marketed heavily to the development community with the lure of 1 program, all windows devices (potenti..."</p>
<hr />
<div>= Why =<br />
* Metro on windows will be big with the launch of windows 8<br />
* Being marketed heavily to the development community with the lure of 1 program, all windows devices (potentially including xbox)<br />
* the default browser setting is shared between metro & classic, meaning that if a user sets IE as their default on metro, if they have it set to firefox on classic, it will still flip that setting. This could severely impact our market share.<br />
* highly desired by Product Management for the H1 product. :)<br />
<br />
= Contact =<br />
* #windev <br />
* There is no mailing list currently, email group <br />
== Team of awesome ==<br />
* mbrubeck - tech lead (front end)<br />
* mfinkle - fennec battle hardened (management) <br />
* jimm (back end, windows guru)<br />
* fryn (front end)<br />
* Asa (product)<br />
* ywang (UX)<br />
=== former eng ===<br />
* jwilde - did a bunch of front end for internship<br />
* bbondy - did a bunch of backend (now on b2g)<br />
<br />
= Day to day Affairs & Meetings =<br />
* Tuesdays 1pm pst - product/ux<br />
* Thursdays 1pm pst - eng focused<br />
* triage sometimes happens at the thursday meetings<br />
<br />
= Where are the bugs? =<br />
* Bugs do not have their own component. Can show up in Firefox or in Widget:Win32<br />
* use "Windows 8 Metro" in the OS field<br />
** https://bugzilla.mozilla.org/buglist.cgi?quicksearch=os%3Ametro%20-sw%3Acompleted-elm;list_id=4562234<br />
<br />
= Where's the code? =<br />
* elm hg branch: http://hg.mozilla.org/projects/elm/<br />
** /browser/metro has the front end code<br />
<br />
= What do I need to build it? =<br />
* http://limpet.net/mbrubeck/2012/09/19/metro-firefox-without-windows.html<br />
* what hardware should we test on?<br />
** Windows boxen w/touch screen. The Samsung slate PC is recommended. <br />
<br />
= Schedule =<br />
* tentative : end of 2012 & middle of 2013<br />
= 1.0 Shipping Requirements =<br />
* more features vs earlier ship?<br />
** may have millions of users in short order due to win8 upgrades<br />
* have not been defined<br />
* scope is unclear<br />
<br />
= Reference =<br />
* https://wiki.mozilla.org/Firefox_Metro_UI</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/DNTAcrossApplicationIds&diff=461024User:Anaaktgeboren/DNTAcrossApplicationIds2012-08-14T22:14:48Z<p>Anaaktgeboren: Created page with "== ohai == * work for bug 652631, which is serving as a side project for me."</p>
<hr />
<div>== ohai ==<br />
* work for bug 652631, which is serving as a side project for me.</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=461003User:Anaaktgeboren/SearchEngineSync2012-08-14T21:55:34Z<p>Anaaktgeboren: </p>
<hr />
<div>== State ==<br />
* After a meeting of mobile product, desktop product, & engineering, this will be set aside for awhile. It is still desired as a feature by the end of the year.<br />
== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* mattn raises a good point that this does not handle recounciling duplicate aliases/keywords. It is currently handled locally on desktop. Should we try to regulate it, or force it to be a client responsibility?<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
** NB: This is also believed to address some of the concern about hijacking.<br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index.<br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
** search suggest api/support should be covered by guts of openSearchRefObj when it becomes relevant<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* make sure search suggest is covered!<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=Firefox/meeting&diff=460532Firefox/meeting2012-08-13T20:55:21Z<p>Anaaktgeboren: </p>
<hr />
<div>== Assumptions held true ==<br />
*FX-Team is an awesome group of people who enjoy each other<br />
** we like to know what others are doing, as well as staying in general sync with <br />
the overall efforts of the company.<br />
** There are often questions, follow ups, or clarifications that merit discussion<br />
** We undertake, as regularly as possible, to meet every monday at 12:10PST/PDT<br />
<br />
== meeting characteristics ==<br />
* it should be excellent<br />
* it should be informative, and on topics that the teams have an interest in<br />
* it should give us a chance to meet new folks, and recognize each other for excellent work<br />
* It should *not* have the following:<br />
** run by johnath and only run when johnath is available<br />
** be, in any way, about what johnath wants to talk about, except possibly as an agendum<br />
** decided about july 2012<br />
<br />
== meeting administration ==<br />
* procedure should retain the generally easy going nature of the team<br />
* we elect a Meeting Master to run the meeting, this should create the following characteristics:<br />
** this is mostly fun, or at least no great inconvenience<br />
** this spreads visibility throughout the team and makes people remember that person over there that they don't talk to much day to day, but basically think is awesome<br />
* if someone gets saddled with the title and doesn't want it, it should be easy enough to fob off on someone via, e.g., an fx-team@ email<br />
* meeting master is a title that is new, so it may evolve, but in any case it is mostly a field designation that, while it has generally positive career and visibility traits, is mostly just a team of people sharing the load<br />
* but at the end of the day, we expect (very nearly demand) that the lack of structure, or at least it's whimsically fluid style, persist. johnath has considered & rejected requests for additional structure.</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=458256User:Anaaktgeboren/SearchEngineSync2012-08-06T20:40:32Z<p>Anaaktgeboren: /* Generic Specification */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* mattn raises a good point that this does not handle recounciling duplicate aliases/keywords. It is currently handled locally on desktop. Should we try to regulate it, or force it to be a client responsibility?<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
** NB: This is also believed to address some of the concern about hijacking.<br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index.<br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
** search suggest api/support should be covered by guts of openSearchRefObj when it becomes relevant<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* make sure search suggest is covered!<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=458254User:Anaaktgeboren/SearchEngineSync2012-08-06T20:39:50Z<p>Anaaktgeboren: /* Specifications */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* mattn raises a good point that this does not handle recounciling duplicate aliases/keywords. It is currently handled locally on desktop. Should we try to regulate it, or force it to be a client responsibility?<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index. <br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
** search suggest api/support should be covered by guts of openSearchRefObj when it becomes relevant<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* make sure search suggest is covered!<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457751User:Anaaktgeboren/SearchEngineSync2012-08-03T23:26:20Z<p>Anaaktgeboren: /* proposed data model for a plugin record v3 */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index. <br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
** search suggest api/support should be covered by guts of openSearchRefObj when it becomes relevant<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* make sure search suggest is covered!<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457750User:Anaaktgeboren/SearchEngineSync2012-08-03T23:23:13Z<p>Anaaktgeboren: /* current problems */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index. <br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* make sure search suggest is covered!<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457747User:Anaaktgeboren/SearchEngineSync2012-08-03T23:22:12Z<p>Anaaktgeboren: /* High level Spec */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Specifications ===<br />
* Still missing a good reconciling algorithm for reordering<br />
* NB: thinking forward to resilient sync, canonical servers, and client engines that aren't us<br />
==== Terms ====<br />
* default plugin, default engine, app shipped plugin. a plugin that is shipped with the firefox build<br />
* custom plugin, custom engine aka user added plugin. plugin added (presumably) by user action<br />
* alias, keyword. user created string that is a shortcut to using a search engine<br />
==== Generic Specification ====<br />
* The goal of sync is the same experience everywhere. There exists one global ordering of search plugins. It may contain disabled, hidden, and platform-specific plugins, which may cause the visible order to be different on different clients.<br />
** For example, a desktop only plugin will not show up on a mobile client.<br />
<br />
* The currently selected engine will not be sync'ed. This is regarded as local to the client. <br />
<br />
* Sync's record may be more data rich/expressive than a particular client's internal representation. Client implementations may choose to disregard pieces of information in the record, but they may not destroy it.<br />
** For example, fennec does not use keywords, but desktop does. syncing fennec should not destroy keywords associated with an engine on desktop.<br />
<br />
* A plugin may be designated for one or more platforms. (Note, this field can be empty, implying it is suitable for use on all clients). If there is a platform designation, clients not in that list must ignore the plugin. They are not install it, alter it, or upload it.<br />
<br />
* Default records of one client implementation cannot be deleted by other clients.<br />
** For example, mobile cannot delete the desktop google plugin.<br />
** Mobile's 'restore defaults' cannot destroy the desktop defaults and vice versa.<br />
<br />
* Removal of custom plugins results in deletions on disk & propagates to other clients. "Removal" of defaults however, results in setting the hidden flag and propagating that change.<br />
<br />
* Hidden & disabled are similar but different concepts. No client should treat them interchangeably, as it will result in inconsistent behavior on other clients. Disabled plugins should appear in UI and not be active. Hidden plugins should not show up in UI and be inactive.<br />
<br />
* Clients must honor a distinction between global disabling and local disabling. Clients may choose (at the direction or needs of their ux) to enable/disable specific plugins valid for their platforms locally. These local decisions should not be propagated via sync.<br />
** Fennec will default to locally disable yahoo, bing, and amazon in their ux, but they should not be disabled on desktop after a mobile client has been synced. <br />
** If a user disables google on mobile, that should be propagated. It is the responsibility of the mobile client in that case to distinguish between the source of the disabling.<br />
<br />
* No special rules for handling keyword addition/removal/change. latest change wins<br />
<br />
* First Sync Behavior. May need special rules for first connecting to the constellation.<br />
<br />
* Reconciling Rules: TBA. currently toying with inserting into list after all hidden & !yourplatform, but before disabled if present at your index. <br />
<br />
==== Additional Specification for Desktop Firefox ====<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Default plugins need to be synced. They are expected to user accessible on mobile, other clients.<br />
* Engines that cannot be serialized probably should not be synced. <br />
* Desktop should implement enable/disable to comply with above spec<br />
<br />
==== Additional Specifications for Firefox Mobile ====<br />
* when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
** this enable/disable for default-on-other-client-but-not-this one is local.<br />
** implies that keywords wont work for disabled engines<br />
* custom plugins must start enabled by default (until user action disables them)<br />
* mobile does not support keywords at this time, but will in the future<br />
* mobile does not support context search for all plugins, but should in the future<br />
<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457740User:Anaaktgeboren/SearchEngineSync2012-08-03T22:41:59Z<p>Anaaktgeboren: /* proposed data model for a plugin record v3 */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
=== proposed data model for a plugin record v3 ===<br />
* name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457739User:Anaaktgeboren/SearchEngineSync2012-08-03T22:40:56Z<p>Anaaktgeboren: </p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
* input <br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
=== proposed data model for a plugin record v3 ===<br />
** name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* reconciling lists remain hard!<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457737User:Anaaktgeboren/SearchEngineSync2012-08-03T22:24:43Z<p>Anaaktgeboren: /* Requirements Gathering */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823, ok as long as based in user action & the defaults w/o user action don't change<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* waiting on feed back<br />
* Spec not right. out pondering<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
=== proposed data model for a plugin record v3 ===<br />
** name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457720User:Anaaktgeboren/SearchEngineSync2012-08-03T21:16:06Z<p>Anaaktgeboren: /* Draft Plan */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* waiting on feed back<br />
* Spec not right. out pondering<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
=== proposed data model for a plugin record v3 ===<br />
** name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457719User:Anaaktgeboren/SearchEngineSync2012-08-03T21:12:08Z<p>Anaaktgeboren: /* proposed data model for a plugin record v3 */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* waiting on feed back<br />
=== proposed data model for a plugin record v3 ===<br />
** name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
isDefault //indicates that this is a default, needed for 'restore defaults'<br />
}<br />
</pre></div><br />
<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457691User:Anaaktgeboren/SearchEngineSync2012-08-03T19:01:39Z<p>Anaaktgeboren: /* Draft Plan */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* waiting on feed back<br />
=== proposed data model for a plugin record v3 ===<br />
** name, description, searchForm, iconurl, urls (very fat object on default engines), url values can be derived from openSearchRefObj<br />
* data not being synced<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
* data model<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
<br />
=== High level Spec ===<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457688User:Anaaktgeboren/SearchEngineSync2012-08-03T18:48:58Z<p>Anaaktgeboren: /* Insights */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* currently full of holes<br />
=== Spec ===<br />
* proposed data model for a plugin record (now out of date as I try to work in the wrinkles exposed by mobile/ux. See below for the v3 wip)<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id<br />
name // similiar but different from the description<br />
alias // optional, if user has set keywords<br />
order // optional if user has reordered engines<br />
hidden // optional, if user has 'deleted' a default engine, or an extensions had hidden a custom one.<br />
description // short description string<br />
searchForm // exists<br />
iconurl // the icon. found on defaults as well. <br />
urls //a nice fat object for included ones, less so for custom probably<br />
url // optional, not found on default<br />
installLocation // optional. if not present, this plugin is default [app]<br />
type //optional<br />
queryCharset //optional<br />
readOnly // optional in the event that we sync readonly plugins in the future<br />
locale // currently all records should have the same value, but it is reasonable for in the future <br />
// for plugins to have different settings for this <br />
<br />
}<br />
</pre></div><br />
<br />
* Not Syncing<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object (so if the ref object changes, we know which one to keep)<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457687User:Anaaktgeboren/SearchEngineSync2012-08-03T18:47:51Z<p>Anaaktgeboren: /* Scratch and Notes */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* currently full of holes<br />
=== Spec ===<br />
* proposed data model for a plugin record (now out of date as I try to work in the wrinkles exposed by mobile/ux. See below for the v3 wip)<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id<br />
name // similiar but different from the description<br />
alias // optional, if user has set keywords<br />
order // optional if user has reordered engines<br />
hidden // optional, if user has 'deleted' a default engine, or an extensions had hidden a custom one.<br />
description // short description string<br />
searchForm // exists<br />
iconurl // the icon. found on defaults as well. <br />
urls //a nice fat object for included ones, less so for custom probably<br />
url // optional, not found on default<br />
installLocation // optional. if not present, this plugin is default [app]<br />
type //optional<br />
queryCharset //optional<br />
readOnly // optional in the event that we sync readonly plugins in the future<br />
locale // currently all records should have the same value, but it is reasonable for in the future <br />
// for plugins to have different settings for this <br />
<br />
}<br />
</pre></div><br />
<br />
* Not Syncing<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* data model draft<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id of the plugin usually looks like [app]google.xml<br />
guid // used for sync reconciliation <br />
openSearchRefObj //the whole of the OpenSearch xml object json-ifed. Clients may pick & choose which bits of data they will use/store in their representation. The sync store however, will hold onto this, to prevent differing internal representations from causing data loss on other platforms. It also ensures sync can in the future gracefully support any future features that are covered by the OpenSearch spec but not by the current internal representations. <br />
age //age in unix time of the ref object<br />
order // place in the global order (beware, even hidden engines have order)<br />
aliases // may be [], array of search keywords associated with this plugin<br />
isHidden // true if this engine should be globally disabled. Note some clients may treat some engines as 'removed' when they are actually disabled. (like desktop never actually removes the defaults even though the ui says it does)<br />
applicationIds // array of ids that this plugin should be installed on. [] if all platforms. (some plugins should not be installed on mobile, like desktop's google plugin, but others like twitter, are suitable for all platforms. Also leaves room for us to indicate a plugin meant for a subset, like mobile platforms {fennec, firefoxOS} and not desktop)<br />
locale //the locale of the plugin. Currently all plugins will have the same locale<br />
installLocation // optional. if not present, this plugin is default [app] on desktop<br />
type //optional, used to differentiate origins of plugins on desktop<br />
queryCharset // defaults on desktop do not have this, may be null<br />
isReadOnly //may be null <br />
}<br />
</pre></div><br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothing has been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457675User:Anaaktgeboren/SearchEngineSync2012-08-03T18:21:44Z<p>Anaaktgeboren: /* Spec */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* currently full of holes<br />
=== Spec ===<br />
* proposed data model for a plugin record (now out of date as I try to work in the wrinkles exposed by mobile/ux. See below for the v3 wip)<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id<br />
name // similiar but different from the description<br />
alias // optional, if user has set keywords<br />
order // optional if user has reordered engines<br />
hidden // optional, if user has 'deleted' a default engine, or an extensions had hidden a custom one.<br />
description // short description string<br />
searchForm // exists<br />
iconurl // the icon. found on defaults as well. <br />
urls //a nice fat object for included ones, less so for custom probably<br />
url // optional, not found on default<br />
installLocation // optional. if not present, this plugin is default [app]<br />
type //optional<br />
queryCharset //optional<br />
readOnly // optional in the event that we sync readonly plugins in the future<br />
locale // currently all records should have the same value, but it is reasonable for in the future <br />
// for plugins to have different settings for this <br />
<br />
}<br />
</pre></div><br />
<br />
* Not Syncing<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothigns been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457217User:Anaaktgeboren/SearchEngineSync2012-08-01T23:43:23Z<p>Anaaktgeboren: /* Dependencies */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* don't require server call to install search engine (like add-on sync does). i.e. data self-contained<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: {{bug|444284}}<br />
* addon sync implemetnation {{bug|534956}}<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* currently full of holes<br />
=== Spec ===<br />
* proposed data model for a plugin record (now out of date as I try to work in the wrinkles exposed by mobile/ux)<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id<br />
name // similiar but different from the description<br />
alias // optional, if user has set keywords<br />
order // optional if user has reordered engines<br />
hidden // optional, if user has 'deleted' a default engine, or an extensions had hidden a custom one.<br />
description // short description string<br />
searchForm // exists<br />
iconurl // the icon. found on defaults as well. <br />
urls //a nice fat object for included ones, less so for custom probably<br />
url // optional, not found on default<br />
installLocation // optional. if not present, this plugin is default [app]<br />
type //optional<br />
queryCharset //optional<br />
readOnly // optional in the event that we sync readonly plugins in the future<br />
locale // currently all records should have the same value, but it is reasonable for in the future <br />
// for plugins to have different settings for this <br />
<br />
}<br />
</pre></div><br />
<br />
* Not Syncing<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* Solving the hijacking problem. Serious concern over syncing crapware<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothigns been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeborenhttps://wiki.mozilla.org/index.php?title=User:Anaaktgeboren/SearchEngineSync&diff=457196User:Anaaktgeboren/SearchEngineSync2012-08-01T21:47:53Z<p>Anaaktgeboren: /* Spec */</p>
<hr />
<div>== Goals ==<br />
* Sync search engine prefs on Desktop<br />
** addition of an engine<br />
** removal of an engine<br />
** reordering of engines<br />
** keywords/aliases for a particular engine<br />
** restore defaults (potentially not a special case for implementation, but could be considered a feature by users)<br />
* Format to be interoperable with firefox os, mobile firefox, or other future clients<br />
<br />
* Nongoals:<br />
** implementation on firefox os<br />
** implementation on mobile firefox<br />
<br />
== Design ==<br />
=== Requirements Gathering ===<br />
* (deadline for input: july 26)<br />
* Stakeholders<br />
** Desktop: Gavin<br />
** Desktop UX: madhava<br />
** Mobile: bnicholson, mfinkle<br />
** B@G: N/A, Ben Francis, b2g has no plugins and few preferences at this time<br />
** Privacy: Tom, Sid<br />
** Security: David Chan<br />
** Product: Asa<br />
** Services Integration: Gps<br />
** Community: dev-planning, dev-apps-firefox lists<br />
** Legal: bug 778823<br />
<br />
=== Current Requirements ===<br />
* does not sync hijacked queries<br />
** origin: Asa, browser cannot currently detect this, requires a new browser feature<br />
* syncs code & not a server call, mitigate risk<br />
** origin sstamm, reducing the addon sync threat<br />
* syncs keywords <br />
* search order preserved<br />
* 3rd party plugins appear<br />
* honors enable/disable<br />
** desktop does not match mobile<br />
* does not assume matching default lists on different clients (which is to say, can't assume google et al are installed everywhere) and syncing of default engine code is likely<br />
* syncs which engines support the search suggest api<br />
<br />
=== Current Suggestions/Notes ===<br />
* input<br />
** want to avoid syncing app-shipped search plugins, origin: gavin<br />
** dont sync XML files, sync the JSON cache that's the result of parse origin: gavin<br />
** mobile uses same nsISearchService as desktop -mfinkle<br />
** should it be applicationID based, the way addons?<br />
** should we limit to a blessed type of plugin to address hijacking?<br />
** impact of Australis?<br />
<br />
=== Design Reviews if needed ===<br />
* privacy security?<br />
* UI changes?<br />
<br />
== Implementation ==<br />
* not started<br />
* desktop will need code changes to address missing enable/disable state for custom search engines<br />
* desktop will need nsSearchService changes to handle a consolidated data format<br />
<br />
== Release ==<br />
** targeted to land on Nightly during Q3 (not a promise, subject to scope change) <br />
<br />
== Reference ==<br />
* this implementation bug: 444284<br />
* addon sync implemetnation bug: 534956<br />
* https://developer.mozilla.org/en/Adding_search_engines_from_web_pages<br />
* http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document<br />
* https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox<br />
* http://docs.services.mozilla.com/sync/index.html<br />
<br />
== Draft Plan ==<br />
* currently full of holes<br />
=== Spec ===<br />
* proposed data model for a plugin record (now out of date as I try to work in the wrinkles exposed by mobile/ux)<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
id // string id<br />
name // similiar but different from the description<br />
alias // optional, if user has set keywords<br />
order // optional if user has reordered engines<br />
hidden // optional, if user has 'deleted' a default engine, or an extensions had hidden a custom one.<br />
description // short description string<br />
searchForm // exists<br />
iconurl // the icon. found on defaults as well. <br />
urls //a nice fat object for included ones, less so for custom probably<br />
url // optional, not found on default<br />
installLocation // optional. if not present, this plugin is default [app]<br />
type //optional<br />
queryCharset //optional<br />
readOnly // optional in the event that we sync readonly plugins in the future<br />
locale // currently all records should have the same value, but it is reasonable for in the future <br />
// for plugins to have different settings for this <br />
<br />
}<br />
</pre></div><br />
<br />
* Not Syncing<br />
** directory - machine specific<br />
** lastModifiedTime - machine & directory specific. used to invalidate cache<br />
** filepath - path to the xml, which wont exist since we arent syncing the xml and would be specific to a machine (where fx is installed, where profile is installed, etc)<br />
<br />
* The OpenSearch plugins, ordering of search engines, keywords for search engines (both custom & default), and hidden flags (default engines only afaik) will be sync'ed across platforms (though the mobile client(s) will be written later)<br />
** parts of default engines will be synced (such as ordering & keywords) <br />
** the currently selected engine will not be synced, as that is a local setting and probably does not make sense to sync<br />
** read-only engines cannot be serialized, and therefore probably should not be sync'ed (I believe this is just the default ones)<br />
* When a user changes or removes a keyword or custom engine, the removal will be synced<br />
* When a user removes a default engine, the removal will be synced (but note that the browser does not actually remove those, it just hides it)<br />
* The results of "Restore Defaults" will be synced (restores all deleted defaults, wipes db to default single entry (ketwords, ordering). This will not be treated as a special operation by sync<br />
* Until the browser implements detecting hijacked searches, this engine will be preffed off by default for existing and new users<br />
* Reconciliation: Merge by Default<br />
** When users choose model from settings, overrides this default?<br />
** what if the default ordering is different on two clients?<br />
* Defaults on other Systems<br />
** when synced to mobile, default engines that are not default on mobile (there are 4 to desktop's 7+) will be disabled (visible but greyed out). Users will have the option to enable those for their system.<br />
*** implies that keywords wont work for disabled engines, but that would be a client decision<br />
** when synced to mobile, user generated/added engines will be automatically enabled<br />
<br />
=== Implementation schedule ===<br />
* largely made up, as the repositories re-write is a huge wild card<br />
* feedback due by 26-jul<br />
* spec finalized by 3-Aug<br />
* Implement store, record for json + tests by 10-aug<br />
* Implement store, record for db(ordering, keywords) + tests by 15-aug<br />
* Implement tracker + xpc tracker tests by 24-aug<br />
* Implement engine + xpc tests by 7-sep<br />
** most likely to get snagged here<br />
* Implement tps tests (if possible, see dependencies) and any remaining xpc tests by sep-14<br />
* Debugging (unknown)<br />
** 'cause there's going to a landmine somewhere<br />
<br />
=== Dependencies ===<br />
* TPS supporting desktop to mobile operations (jgriffin's team)<br />
**TPS new data tupe addition (jgriffin's team)<br />
* Desktop client supporting hijacked search detection (gavin?)<br />
** so engine can be enabled by default for new or existing users<br />
* Someone implementing the corresponding mobile engine (?)<br />
* repositories rewrite (gps)<br />
<br />
=== Test Plan ===<br />
==== TPS Tests ====<br />
* Important Notes<br />
** tps does not support the native mobile at this time. timeframe unknown for support<br />
** dependency - adding a new engine will require work on tps. timeframe unknown, but likely to be reasonable<br />
*** tests cannot really be written ahead of those changes to tps <br />
* Tests<br />
** only reordering syncs between profile 1 & profile 2<br />
** only keyword addition, change, and removal sync between profile 1 & 2<br />
** adding and removing a search engine plugin syncs between profile 1 & 2<br />
** add plugin, add keyword, reorder, sync between two desktops, remove & sync again <br />
** add plugin, add keyword, reorder, sync between mobile (if mobile client exists) & desktop, remove & sync again<br />
<br />
==== XPC Shell Tests ====<br />
* make sure there is heavy testing about reordering with hidden & default engines, as some of the calls may have unexpected side effects (and some functions consider hidden in counts and others do not, same deal with what counts as default)<br />
* impacted by repositories re-write?<br />
<br />
== Scratch and Notes ==<br />
=== Insights ===<br />
* what should happen when default lists dont match<br />
** defaults should be synced because they may not be present on other systems and users can expect to see them (though the mobile client may grey them out)<br />
* user created keywords are called 'alias'es in code, stored in search-metadata.json<br />
* search-metadata.json<br />
** may not exist if nothigns been changed<br />
** contains per plugin: order placement, hidden, and keywords<br />
* /profile/search.json<br />
** "directories" will have two entries, the default one ("/Applications/Firefox.app/Contents/MacOS/searchplugins") & "/Users/mozilla/Documents/inbox-desktop/test_profiles/searchplugins" in my case) The first has no usefully syncable data, though it does have a lastModifiedTime (this is the lastModifiedTime of the directory, used for cache invalidation --Gavin)<br />
* JAR loading code is for mobile, for their default plugin handling<br />
* Australis is not making the search engines or their data go away<br />
* "Search service changes will be required for this, almost certainly. Exposing the engine description as JSON and adding the ability to distinguish app-shipped plugins via the nsIBrowserSearchService API seem like good first steps to me" - gavin<br />
** Mobile will support search keywords & search suggest in the nearish future.<br />
* /profile/search.sqlite(DO NOT SYNC) (this is no longer used after bug 699856, replaced by search-metadata.json --Gavin)<br />
* pref browser.search.selectedEngine represents the currently selected entry, status "user set" is useful<br />
* pref browser.search.useDBForOrder i bet that represents ordering (this gets set to true once the user has customized the search engine order, to indicate that we should use the positioning information in search-metadata.json rather than the one in default prefs (browser.search.order.*) --Gavin)<br />
* pref browser.search.order.1-3 are hard coded defaults. do not sync<br />
<br />
=== current problems ===<br />
* search suggest has global preferences associated with it. to sync or not to sync?<br />
** and if so, should it go in the preferences engine, or in this one? I'm inclined to think it matters even if engines are not synced<br />
<br />
* mobile has state that desktop does not (enable/disable)<br />
* mobile will want more state about usage than desktop does<br />
* how do i gracefully slurp the json content?<br />
* design pondering<br />
<br />
=== What do these data formats look like anyway? ===<br />
* search-metadata.json. reordering + keywords. Note this file can be empty<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"[app]/google.xml":<br />
{<br />
"hidden":true,<br />
"alias":null,<br />
"order":1<br />
},<br />
"[profile]/youtube-video-search.xml":<br />
{<br />
"order":2,<br />
"alias":"anaaktge_test_keyword"<br />
},<br />
"[app]/bing.xml":<br />
{<br />
"order":3<br />
},<br />
"[app]/amazondotcom.xml":<br />
{<br />
"order":4,<br />
"alias":"anaaktge_test_keyword_default"<br />
},<br />
"[app]/eBay.xml":<br />
{<br />
"order":5<br />
},<br />
"[app]/twitter.xml":<br />
{<br />
"order":6<br />
},<br />
"[app]/wikipedia.xml":<br />
{<br />
"order":7<br />
},<br />
"[app]/yahoo.xml":<br />
{<br />
"order":8<br />
}<br />
}<br />
</pre></div><br />
* search.json, one default plugin, one custom (youtube) plugin<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"version":7,<br />
"buildID":"20120730133507",<br />
"locale":"en-US",<br />
"directories":<br />
{<br />
"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins":<br />
{<br />
"lastModifiedTime":1343683762000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[app]/amazondotcom.xml",<br />
"_name":"Amazon.com",<br />
"_hidden":false,<br />
"description":"Amazon.com Search",<br />
"__searchForm":"http://www.amazon.com/",<br />
"_iconURL":"data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.amazon.com/exec/obidos/external-search/",<br />
"rels":[],<br />
"params":<br />
[<br />
{<br />
"name":"field-keywords",<br />
"value":"{searchTerms}"<br />
},<br />
{<br />
"name":"mode",<br />
"value":"blended"<br />
},<br />
{<br />
"name":"tag",<br />
"value":"mozilla-20"<br />
},<br />
{<br />
"name":"sourceid",<br />
"value":"Mozilla-search"<br />
}<br />
]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/moz/hg/services-central/./obj-x86_64-apple-darwin11.4.0/dist/NightlyDebug.app/Contents/MacOS/searchplugins/amazondotcom.xml"<br />
}<br />
]<br />
}<br />
"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins":<br />
{<br />
"lastModifiedTime":1343685412000,<br />
"engines":<br />
[<br />
{<br />
"_id":"[profile]/youtube-video-search.xml",<br />
"_name":"YouTube Video Search",<br />
"_hidden":false,<br />
"description":"Search for videos on YouTube",<br />
"__searchForm":"http://www.youtube.com",<br />
"_iconURL":"data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==",<br />
"_urls":<br />
[<br />
{<br />
"template":"http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch",<br />
"rels":[],<br />
"params":[]<br />
}<br />
],<br />
"filePath":"/Users/mozilla/Documents/inbox-desktop/test_profiles/search_engine_sync_0/searchplugins/youtube-video-search.xml",<br />
"_url":"http://www.youtube.com/opensearch?locale=en_US",<br />
"_installLocation":2,<br />
"type":3,<br />
"queryCharset":"UTF-8",<br />
"_readOnly":false<br />
}<br />
]<br />
}<br />
}<br />
}<br />
<br />
</pre></div><br />
* profile/searchplugins/ .xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"><br />
<os:ShortName>YouTube Video Search</os:ShortName><br />
<os:Description>Search for videos on YouTube</os:Description><br />
<os:InputEncoding>UTF-8</os:InputEncoding><br />
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA==</os:Image><br />
<os:Url type="text/html" method="GET" template="http://www.youtube.com/results?search_query={searchTerms}&amp;page={startPage?}&amp;utm_source=opensearch"><br />
</os:Url><br />
</SearchPlugin><br />
<br />
</pre></div><br />
* google search xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Google</ShortName><br />
<Description>Google Search</Description><br />
<InputEncoding>UTF-8</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA</Image><br />
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/><br />
<Url type="text/html" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
</Url><br />
<!-- Keyword search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-keywordsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="fflb"/><br />
</Url><br />
<!-- Context/Right-click search URL is the same as the default, but with an additional parameter --><br />
<Url type="application/x-moz-contextsearch" method="GET" template="https://www.google.com/search"><br />
<Param name="q" value="{searchTerms}"/><Param name="ie" value="utf-8"/><Param name="oe" value="utf-8"/><Param name="aq" value="t"/><Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/><br />
<MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/><br />
<Param name="channel" value="rcs"/><br />
</Url><br />
<SearchForm>https://www.google.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* amazon xml<br />
<div style="background-color: #F0F0F0"><pre><br />
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"><br />
<ShortName>Amazon.com</ShortName><br />
<InputEncoding>ISO-8859-1</InputEncoding><br />
<Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg==</Image><br />
<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/"><br />
<Param name="field-keywords" value="{searchTerms}"/><br />
<Param name="mode" value="blended"/><br />
<Param name="tag" value="mozilla-20"/><br />
<Param name="sourceid" value="Mozilla-search"/><br />
</Url><br />
<SearchForm>http://www.amazon.com/</SearchForm><br />
</SearchPlugin><br />
</pre></div><br />
* Now let's turn those xml documents into JSON (records must contain JSONable code) (google, amz, custom(youtube))<br />
<div style="background-color: #F0F0F0"><pre><br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Google",<br />
"Description": "Google Search",<br />
"InputEncoding": "UTF-8",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA"<br />
},<br />
"Url": [<br />
{<br />
"-type": "application/x-suggestions+json",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/complete/search?client=firefox&q={searchTerms}"<br />
},<br />
{<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-keywordsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "fflb"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
},<br />
{<br />
"-type": "application/x-moz-contextsearch",<br />
"-method": "GET",<br />
"-template": "https://www.google.com/search",<br />
"Param": [<br />
{<br />
"-name": "q",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "ie",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "oe",<br />
"-value": "utf-8"<br />
},<br />
{<br />
"-name": "aq",<br />
"-value": "t"<br />
},<br />
{<br />
"-name": "rls",<br />
"-value": "{moz:distributionID}:{moz:locale}:{moz:official}"<br />
},<br />
{<br />
"-name": "channel",<br />
"-value": "rcs"<br />
}<br />
],<br />
"MozParam": {<br />
"-name": "client",<br />
"-condition": "defaultEngine",<br />
"-trueValue": "firefox-a",<br />
"-falseValue": "firefox"<br />
}<br />
}<br />
],<br />
"SearchForm": "https://www.google.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"ShortName": "Amazon.com",<br />
"InputEncoding": "ISO-8859-1",<br />
"Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZJREFUeNrEV01IFGEYfndXNzq0QdalJOoUbQiBUuopD2k/GFSG/Vxyq0OHbCUjwn7AEooUzUNRkdkhS1o9JBVaUDctKqhoRQi0WjtlxG6XVtfpfb6Z2caZ2ZnZXZdeeJxvx+973+f9+775XJIkkUaWMcoYG5TxfMpvxlvGMGM8+RYEFOxn/JJyLzOMiwwv7LqUCNQwHjpxIxKJ0Gg4LABZUVhIfr+f1jLSlNuMwyCwEHoZS6xmvxoZoc6Oq+JpJoVMpOncWdpcWZkOiRIQ2MKDp1az+kIhOtV40pHG6zdvpEOixc1/VtqFvKX5gmOX0pkL2yDgsZpxt+sORaPROe8Q6ncf3tPAk8eG3Ks14lA8brsZYZ2yukBAwOfzCeMHA3WGNXrCVpLnJKeqRyhAfX5RfNmILQF4urG0VIzxBBkU5aQI9agIeU4JqNLZ0UH9ob6sDWZE4MDefSn7P1txO/FcbxypQG18nhinew/u5zYC3dyG+qLL1qjjCKDg9C21q2a3oe9zRsCsn2PR2JzfKEy9PB96Nj8E0IJm54IaGZwPZsWJOU4jY1kD2OlAQhsJjKu3bSe7yPUzifpgMPsuOBY8brtR1evmyFt0IL0IzH4fJtcCH7kK1hn2/hh71G1yKKEdz/DBBIOTkUkRemzVl1uvCGKzE4OMIaFbiv1LSX51L7mXl4kxvgeO8vMaJk0PHiHvjl4DCTWs2lMOX0L6cwD/Bxlp6hNNv2gUT9MjsLiB8koaMOxJRgCMgPijWsqvaCP3qqqUZ4JVzUASYyFyL/WTqyggPxWH4qGtBlJzagCGIYjEzJv2zHe38vOUt6mNPGv20OyPMMV7yuVwL5IjBlLmRej1UX7VLdmLt+2CMVKTiSDn0wO1NPPyBOtdLL+MyzWkTbGhC5AGsBdKkEtWAjglgjUwCq/FGjhV0ZosdOhXI5FyH0DoIIK9slB0CS8UCgr8AlpvpamwqHpttcO4WtSqA57ioKENE05IqIYSY46uD4Is0qmGG2s9RYeS7adI3Paz3K6lTMmzIdFmXp/d1Gb1YvLF7i4IzxMfu1ITYWOe1VWix7U5tlKpXkzwYycONqfVLcW+cU7lQ0jePf360DqRS4zT/+Ny+ofRxPBoL6fa6zmu5uvtbkwZyE/lev6a8VV9+VeAAQADg36zc4GRNAAAAABJRU5ErkJggg=="<br />
},<br />
"Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.amazon.com/exec/obidos/external-search/",<br />
"Param": [<br />
{<br />
"-name": "field-keywords",<br />
"-value": "{searchTerms}"<br />
},<br />
{<br />
"-name": "mode",<br />
"-value": "blended"<br />
},<br />
{<br />
"-name": "tag",<br />
"-value": "mozilla-20"<br />
},<br />
{<br />
"-name": "sourceid",<br />
"-value": "Mozilla-search"<br />
}<br />
]<br />
},<br />
"SearchForm": "http://www.amazon.com/"<br />
}<br />
}<br />
<br />
{<br />
"SearchPlugin": {<br />
"-xmlns": "http://www.mozilla.org/2006/browser/search/",<br />
"-xmlns:os": "http://a9.com/-/spec/opensearch/1.1/",<br />
"os:ShortName": "YouTube Video Search",<br />
"os:Description": "Search for videos on YouTube",<br />
"os:InputEncoding": "UTF-8",<br />
"os:Image": {<br />
"-width": "16",<br />
"-height": "16",<br />
"#text": "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgNkQkIDZGiCA2RzAgNkcwIDZH/CA2R/wgNkf8IDZH/CA2R/wgNkf8IDZH/CA2R2AgNkcwIDZHMCA2RhAgNkQYIDpWHCA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpX/CA6V/wgOlf8IDpWHCQ6ZzAkOmf8JDpn/CQ6Z/wkOmf8JDpb/BQhc/wgMgf8JDpn/CQ6Z/wkOmf8JDpn/CQ6Z/wkOmf8JDpn/CQ6ZzAkOnuoJDp7/CQ6e/wkOnv8JDp7/Exed/8jIy/9RU4j/Bwp0/wkOm/8JDp7/CQ6e/wkOnv8JDp7/CQ6e/wkOnuoJD6T8CQ+k/wkPpP8JD6T/CQ+k/xUbo//V1dX/1dXV/4yNrP8QFG//CA6Y/wkPpP8JD6T/CQ+k/wkPpP8JD6T8CQ+q/wkPqv8JD6r/CQ+q/wkPqv8WG6n/3d3d/93d3f/d3d3/v7/M/y0wjv8JD6r/CQ+q/wkPqv8JD6r/CQ+q/woQr/8KEK//ChCv/woQr/8KEK//Fx2v/+fn5//n5+f/5+fn/+jo6P+YmtP/ChCv/woQr/8KEK//ChCv/woQr/8KELX8ChC1/woQtf8KELX/ChC1/xgdtf/x8fH/8fHx//Ly8v+bndv/Ehi3/woQtf8KELX/ChC1/woQtf8KELX8ChG76goRu/8KEbv/ChG7/woRu/8YH77/+fn5/+/v9/9fY9H/ChG7/woRu/8KEbv/ChG7/woRu/8KEbv/ChG76goRwMwKEcD/ChHA/woRwP8KEcD/EBfB/6Ol5/8tM8n/ChHA/woRwP8KEcD/ChHA/woRwP8KEcD/ChHA/woRwMwLEcSHCxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcT/CxHE/wsRxP8LEcSHCxLICQsSyKULEsjMCxLI+QsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI/wsSyP8LEsj/CxLI0gsSyMwLEsiiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAD//wAA//8AAA=="<br />
},<br />
"os:Url": {<br />
"-type": "text/html",<br />
"-method": "GET",<br />
"-template": "http://www.youtube.com/results?search_query={searchTerms}&page={startPage?}&utm_source=opensearch"<br />
}<br />
}<br />
}<br />
</pre></div><br />
<br />
=== Digging around in the code Pointers ===<br />
** http://jsontoxml.utilities-online.info/ convert between the two data formats<br />
** changes frequently dont show up immediate (but get written on close)<br />
** ordering in data store includes hidden engines. the number may not match the observed number<br />
*** note in the example below all engines are off by 1 because google is order:1 and hidden, so youtube appears first in the list but has order:2<br />
** getting a 3rd party search thingy<br />
*** right click on a website search bar (ie youtube) and /profile/searchplugins will be created with an OpenSearch .xml<br />
*** searchplugins doesn't exist until you create a non-default one<br />
** SQLite table: install addon, go to tools -> SQLiteManager -> select db, go<br />
** default engines have a hidden value, which afaic, is never applied to custom engines?</div>Anaaktgeboren