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: 
You can solve this in two ways,

First, you can write a firefox extension which executes a javascript on page load and assigns empty function to console.clear. So, it doesn't throw any error if its called.

```js
console.clear = () => {}

```

References for building extension to run on page load
[Chrome Extension: Make it run every page load](https://stackoverflow.com/questions/6497548/chrome-extension-make-it-run-every-page-load)
<https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Modify_a_web_page>

Secondly, you can load the page once and open devtools and goto sources and search for `console.clear` and add breakpoints every where its called and reload the page. The code execution will stop when the console.clear is called for the first time and again you can goto console and assign console.clear with empty function and override.

Reference for Using BreakPoints in Firefox
<https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Set_a_breakpoint>
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.