B2G/MarketCustomizations: Difference between revisions

Jump to navigation Jump to search
Line 316: Line 316:




=== Browser Bookmarks & Search Engines ===
=== Browser Bookmarks & Default Search Engine ===
Default bookmarks, the list of available search engines and the default search engine can be customised at build time, with different variants for each country and network in a single build. The customised data is inserted into the browser app the first time it is run, based on the MCC and MNC codes of the SIM card present in the device at the time.
The default bookmarks and default search engine can be customised at build time, with different variants for each country and network in a single build. The customised data is inserted into the browser app the first time it is run, based on the MCC and MNC codes of the SIM card present in the device at the time.


'''Note:''' Bookmarks can be customised from version 1.0.1 and search engines can be customised from version 1.2.
'''Note:''' Bookmarks can be customised from version 1.0.1 and default search engine can be customised from version 1.2.


The example below shows a configuration for Vivo in Brazil (724006, where 724 is Brazil and 006 is Vivo according to the MCC and MNC codes [http://en.wikipedia.org/wiki/Mobile_country_code listed on Wikpedia]), and a default fallback (000000) in case a non-matching SIM card or no SIM card is present.
The example below shows a configuration for Vivo in Brazil (724006, where 724 is Brazil and 006 is Vivo according to the MCC and MNC codes [http://en.wikipedia.org/wiki/Mobile_country_code listed on Wikpedia]), and a default fallback (000000) in case a non-matching SIM card or no SIM card is present.
Line 340: Line 340:
     ],
     ],
     'searchEngines' : [
     'searchEngines' : [
      {
        {
        'title': 'Google',
          'title': 'Google',
        'uri': 'http://www.google.com/search',
          'uri': 'http://www.google.com/search?q={searchTerms}',
        'iconUri':
          'iconUri':
          'data:image/png;base64,AAABAAIAEBAAAAEAIABoBAAA[truncated]'
            'data:image/png;base64,AAABAAIAEBAAAAEAIABoBAA[truncated]'
      },
        }
      {
      ],
        'title': 'DuckDuckGo',
      'settings' : {
        'uri': 'https://duckduckgo.com/',
        'defaultSearchEngine': 'http://www.google.com/search?q={searchTerms}'
        'iconUri':
      }
          'data:image/png;base64,AAABAAMAEBA[truncated]'
      }
    ],
    'settings' : {
      'defaultSearchEngine': 'http://www.google.com/search'
    }
   },
   },
   
   
Line 375: Line 369:
     ],
     ],
     'searchEngines' : [
     'searchEngines' : [
      {
        {
        'title': 'Yahoo',
          'title': 'Yahoo',
        'uri': 'http://search.yahoo.com/search',
          'uri': 'http://search.yahoo.com/search?q={searchTerms}',
        'iconUri':
          'iconUri':
          'data:image/png;base64,AAABAAIAEBAAAAE[truncated]'
            'data:image/png;base64,AAABAAIAEBAAAAEAIABoBAA[truncated]'
      },
        }
      {
      ],
        'title': 'Bing',
      'settings' : {
        'uri': 'http://www.bing.com/search',
        'defaultSearchEngine': 'http://search.yahoo.com/search?q={searchTerms}'
        'iconUri':
      }
          'data:image/png;base64,AAABAAEAEBAAAA[truncated]'
      }
     ],
     ],
     'settings' : {
     'settings' : {
       'defaultSearchEngine': 'http://search.yahoo.com/search'
       'defaultSearchEngine': 'http://search.yahoo.com/search?q={searchTerms}'
     }
     }
   }
   }
  };
  };


In the example, if a Vivo SIM card from Brazil is entered on first run the user will see Vivo bookmarks and Yahoo as the default search engine, with Yahoo and Bing as search engines for the user to choose from. If another SIM card or no SIM card is entered on first run the user will see Mozilla bookmarks and Google as the default search engine with Google and DuckDuckGo as search engines for the user to choose from.
In the example, if a Vivo SIM card from Brazil is entered on first run the user will see Vivo bookmarks and Yahoo as the default search engine. If another SIM card or no SIM card is entered on first run the user will see Mozilla bookmarks and Google as the default search engine.
 
The "defaultSearchEngine" property '''must''' match the "uri" property of the search engine specified. This string acts as a template where the "{searchTerms}" placeholder which will get replaced with the user's search query at run time. Other values such as search strings may be appended to the query string in the URL template.


'''Note:''' The favicon URLs shown are base64 encoded data URLs of the image data (truncated for brevity) rather than HTTP URLs. This is recommended so that the icons will still appear the first time the browser is run even if the user has not connected to the Internet yet.
The favicon URLs shown are base64 encoded data URLs of the image data (truncated for brevity) rather than HTTP URLs. This is recommended so that the icons will still appear the first time the browser is run even if the user has not connected to the Internet yet.


Notice that multiple customisations can be applied for different networks and different countries in a single build, with a different 6 digit code representing each variant. The 6 digit code is constructed from the MCC code plus the MNC code, each padded with zeros to ensure it is 3 digits long.
Notice that multiple customisations can be applied for different networks and different countries in a single build, with a different 6 digit code representing each variant. The 6 digit code is constructed from the MCC code plus the MNC code, each padded with zeros to ensure it is 3 digits long.
Confirmed users
394

edits

Navigation menu