Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically enable panels in chrome chrome://flags/#enable-panels

I know how to manually enable panels in Chrome. I have written a chrome extensions that uses panels. Unfortunately users have to enable that manually first.

chrome.windows.create({type:"panel", url: temp, width:pos.w,height:pos.h, top:pos.top, left:pos.left}, function (_win) {
    win = _win.id;
});

Question: is it possible to have panel feature enabled for an extension WITHOUT having to do that manually?

like image 533
yarek Avatar asked Mar 14 '23 09:03

yarek


2 Answers

You can't from within an extension, period.

Chrome flags are experimental features and you should never assume that they are present.

If you have some sort of external installer, you could modify Chrome's shortcuts to include the --enable-panels flag; but that's considered browser hijacking and is unreliable (Google constantly pushes against malware that uses similar techniques).

At least with chrome.tabs.create you can specifically open chrome://flags/#enable-panels after explaining to your user to enable it.

like image 84
Xan Avatar answered Apr 08 '23 17:04

Xan


It isn't documented yet, but panels are enabled by default for Chrome OS apps since 45. You will need to split functionality and use external messaging. On other systems, you can fallback to an alwaysOnTop window (alwaysOnTopWindows permission). You will need to put it in the lower right yourself.

chrome.app.window.create("test.html", { alwaysOnTop: true, type: "panel" })
like image 32
Daniel Herr Avatar answered Apr 08 '23 17:04

Daniel Herr