XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Popup: Add standalone control panel link

Open marcustyphoon opened this issue 2 years ago • 10 comments

Just an idea I had.

Description

This adds a link to the XKit Rewritten control panel that opens it in a new tab, useful for e.g. copying lots of tag bundles from XKit 7.

Obviously (to us), what this provides is a duplicate of the feature in the browser's extension preferences page to open the control panel embedded there, but a) most people don't know about that, and maybe more people will find this version, and b) Chromium's version of the embedded preference pane kinda sucks. Yes, yes, Firefox best bae etc.

Bonus points for the ability to use inspect element on the preference pane without the shadow DOM getting in the way.

Testing steps

marcustyphoon avatar Aug 13 '23 01:08 marcustyphoon

isn't there a method for opening the preferences pane...?

AprilSylph avatar Aug 13 '23 01:08 AprilSylph

also, this is kinda already a feature, just a hidden one:

image

AprilSylph avatar Aug 13 '23 01:08 AprilSylph

Oh, yeah, it's certainly possible to access a non-popup version without this. All this does is add a link in a location where someone might go looking for it. (Well: a link and CSS that makes the standalone web view look fuller-sized like the Firefox extension preference view, but not ultra-stretched.)

(Also: interesting. It would—or, I guess, did—not occur to me to treat a navigation button like a link and expect it to randomly have an href to the current page. If there was still a header on the top with "XKit Control Panel" and it'd had cursor: pointer or something, I'd certainly have tried that. My method was [right click the button -> select options if in chromium; just left click if in firefox] -> right click -> view source -> edit the front of the URL off of the view source page.)

marcustyphoon avatar Aug 13 '23 02:08 marcustyphoon

isn't there a method for opening the preferences pane...?

Do you mean right click the button -> options in chromium /// right click the button -> manage -> preferences in firefox?

marcustyphoon avatar Aug 13 '23 02:08 marcustyphoon

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/openOptionsPage

AprilSylph avatar Aug 13 '23 10:08 AprilSylph

Oh! You meant for the developer, gotcha. Interesting. This PR has different URL parameters for embedded vs in-a-new-tab, at the moment, but that's not really necessary.

marcustyphoon avatar Aug 13 '23 10:08 marcustyphoon

Drafting this because ostensibly the correct way to do it is to unify the "embedded" and "is in a browser window" modes (and maybe make the embedded banner prettier), but I cannot be bothered to figure out what this is supposed to mean at the moment:

html, main {
  width: 375px;
  min-width: 100%;
  max-width: 100%;
}

marcustyphoon avatar Aug 14 '23 22:08 marcustyphoon

if the popup width is controlled by the content width, the popup is 375px wide if the popup width is controlled by something else, e.g. was inside the firefox overflow menu pre-whatever version the extensions button was added, the content width instead shrinks or grows to match the popup width

AprilSylph avatar Aug 15 '23 20:08 AprilSylph