javascript - Open a Chrome app within a tab - Stack Overflow

This issue started with version 23 of Google Chrome. My Chrome app opens a tab to display its UI when t

This issue started with version 23 of Google Chrome. My Chrome app opens a tab to display its UI when the launched event fires.

chrome.app.runtime.onLaunched.addListener(function() 
{
   chrome.tabs.create(
   {
      url: "../../index.html"
   });
});

This scheme was working previous to version 23 of Google Chrome. Now receiving the following exception when running my app.

Error in event handler for 'app.runtime.onLaunched': Cannot call method 'create' of undefined TypeError: Cannot call method 'create' of undefined

After checking the chrome object in developer tools I notice that chrome.tabs is undefined.

I know that I dont have to explicitly set a "tabs" permission in my manifest.json because according to .html the create, update, and remove methods dont require the "tabs" permission.

After trying to explicitly add the "tabs" permission to the manifest.json file I then receive this message on chrome://chrome/extensions/ for the app.

There were warnings when trying to install this extension: 'tabs' is only allowed for extensions and legacy packaged apps, and this is a packaged app.

If I am going by the chart given by and have chosen a packaged app because my app's UI is not small and I dont intend on extending Chrome's UI and I cannot make use of chrome.tabs then how can I open my app's UI inside of a new or existing tab without having to create a popup window (which is very annoying and not user friendly)?

This issue started with version 23 of Google Chrome. My Chrome app opens a tab to display its UI when the launched event fires.

chrome.app.runtime.onLaunched.addListener(function() 
{
   chrome.tabs.create(
   {
      url: "../../index.html"
   });
});

This scheme was working previous to version 23 of Google Chrome. Now receiving the following exception when running my app.

Error in event handler for 'app.runtime.onLaunched': Cannot call method 'create' of undefined TypeError: Cannot call method 'create' of undefined

After checking the chrome object in developer tools I notice that chrome.tabs is undefined.

I know that I dont have to explicitly set a "tabs" permission in my manifest.json because according to http://developer.chrome./extensions/tabs.html the create, update, and remove methods dont require the "tabs" permission.

After trying to explicitly add the "tabs" permission to the manifest.json file I then receive this message on chrome://chrome/extensions/ for the app.

There were warnings when trying to install this extension: 'tabs' is only allowed for extensions and legacy packaged apps, and this is a packaged app.

If I am going by the chart given by https://developers.google./chrome/web-store/docs/choosing and have chosen a packaged app because my app's UI is not small and I dont intend on extending Chrome's UI and I cannot make use of chrome.tabs then how can I open my app's UI inside of a new or existing tab without having to create a popup window (which is very annoying and not user friendly)?

Share Improve this question edited Dec 10, 2013 at 7:28 Kara 6,22616 gold badges53 silver badges58 bronze badges asked Oct 29, 2012 at 3:53 cs_brandtcs_brandt 1,1671 gold badge10 silver badges15 bronze badges 3
  • I dont see there is API chrome.app.runtime for chrome extensions, it's only available for chrome app. developer.chrome./apps/api_index.html – Jacob Dam Commented Nov 10, 2012 at 10:22
  • right, it is a packaged app.. – cs_brandt Commented Nov 10, 2012 at 17:09
  • So there are no chrome.tabs API for packaged app I think. developer.chrome./apps/api_index.html – Jacob Dam Commented Nov 11, 2012 at 9:55
Add a ment  | 

1 Answer 1

Reset to default 8

Have you tried window.open() in chrome.app.runtime.onLaunched

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744219584a4563716.html

相关推荐

  • javascript - Open a Chrome app within a tab - Stack Overflow

    This issue started with version 23 of Google Chrome. My Chrome app opens a tab to display its UI when t

    8天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信