Question: I have two tables `Major(majorId, label)` and `Minor(minorId, majorId)`.

I want return Major ordered by the count of Minor (and label).

Something like:

```
SELECT majorId,
       label
FROM Major ma
ORDER BY
  (SELECT COUNT(*)
   FROM Minor mi
   WHERE mi.majorId=ma.majorId), label;

```

The way I imagining it working is: The Minor table is grouped by majorId and then rows are counted for each majorId and then the Major table is sorted by that coresponding count and then by label.

Answer: 
Since you're asking about Firefox, if you don't want to write your own extension, you can use the one that already exists:

[Disallow Console Clear Firefox Addon](https://addons.mozilla.org/en-US/firefox/addon/disallow-console-clear/)
It is right to hijack the `console.clear` on page load.

---

Here just a tip/record.

[For some sites, there would be no explicit word `console.clear` in the sources. (And sadly, currently Firefox's `Preserve Log` option might still not be as powerful as Chrome's)](https://stackoverflow.com/q/73589389/7860292)

But the hijack might still work even!

BTW it might happen that "directly reassigning `console.clear` in console" not works.

So just try it.