You know how onions - especially sweet onions - sprout on the counter in winter? I leave a few to do that intentionally, since the sweet greens give me a few onion tops to use as I would chives or scallions.. If the leaves are pulled out they bring white onion with them, and then they're even more suitable as a substitute for scallions, but I usually only clip the greens, which continue to grow.
This year some of my yellow keeping onions stayed out on the lawn too long before I brought them in (as in, pulled them from the frozen ground where they had rerooted themselves, after the first snow of the year). They aren't going to be keepers as a result of rerooting, but they're doing a fine job of growing tops. Onions are biennials, and if left in the ground over the winter they'll send up a seed stalk the second year. These onions of mine now think it's their second year.
The greens from keeping onions are generally pretty hot in the summer, but are much milder when pushing their way out of the onion on your shelf. If you're buying onions to sprout then buy sweet onions, which start to sprout earlier in the winter. No need to put them in the window; they have plenty of light on the counter.