版权声明:本文为博主打劫来的文章!!!未经允许可以随便转载。 May you do good and not evil. May you share freely, never taking more than you give. https://blog.csdn.net/hunter___/article/details/81227752

官方文档说shell.js 打开 system app,

shell.js

system app 打开homescreen ?

b2g.js 导入/打开system app?

 system app 再往iframe里加载其他app,如hscr,

 

https://blog.csdn.net/zembers/article/details/48783737

几个问题:

  1. homeURL(b2g.system_startup_url):

     app://system.gaiamobile.org/index.html
    
     "app:// for packaged app resources"
  2. manifestURL:

    app://system.gaiamobile.org/manifest.webapp
    
    "app:// for packaged app resources"
  3. system app实际上是一个iframe
    let systemAppFrame =
      document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');

该iframe是放在shell.html中id为”container”中:

 let container = document.getElementById('container');
 ...
 this.contentBrowser = container.appendChild(systemAppFrame);
 ...

4.systemapp的iframe实际上有一系列属性:

    systemAppFrame.setAttribute('id', 'systemapp');
    systemAppFrame.setAttribute('mozbrowser', 'true');
    systemAppFrame.setAttribute('mozapp', manifestURL);
    systemAppFrame.setAttribute('allowfullscreen', 'true');
    systemAppFrame.setAttribute('src', 'blank.html');

system app的iframe里放的是 ‘blank.html’。其它属性:

    mozbrowser: 
        An "iframe" is turned into a browser frame by setting the mozbrowser attribute

    mozapp:
        see [mozapp](https://wiki.mozilla.org/Security/Reviews/B2G/mozapp)

system app刚开始加载的是

'blank.html',

也就是没有界面的,之后开始加载

homeURL,即"app://system.gaiamobile.org/index.html"

“system.gaiamobile.org”,实际上就是gaia里的system app。该app负责系统ui的显示以及home应用的加载等工作。

问题是:

b2g进程、system进程与Home进程的关系是什么样的? Home进程是如何创建出来的?

system app 是个iframe,