Chrome extension hidden / non

Part of my extension involves accessing a webpage and then programatically performing certain functions for the user. The app would obviously be much cleaner if the user did not have to see all this happening in a browser window.

In some situations this could be achieved by, displaying other content (useful to the user) in a browser window, loading the screen with the programmatic elements in an iframe and manipulating them through an action script that triggers on the page load of the page loaded in the iframe.

However, for my purposes this is obstructed partially by the cross-domain limitations and totally by the fact that site in question does not allow iframes.

(One solution was to reverse this process--ie direct the browser to the correct page and throw up the useful content in front of it, thereby hiding the noise while loading the page in the browser. This works but it is horrible for obvious reasons)

Is there any clean way to either:

  • Open a chrome window but keep it hidden? or
  • Load a page (ie have a DOM built etc) without doing so in a window/tab?

  • Have you tried using

    chrome.windows.create({url:yourUrl, focused:false, state:"minimized"}, function(hiddenWindow){
        //do whatever with hidden window
    });
    

    or having an <iframe> in the background.html of your extension?

    链接地址: http://www.djcxy.com/p/18344.html

    上一篇: <iframe>内的欺骗导航器

    下一篇: Chrome扩展程序隐藏/不显示