Thanks, @Wilberforce and @Gordon!
Actually I'm running on a Mac, which should not make much difference anyway, so I'll try compiling for linux. Of course, doing a complete emulator that behaves just the same would be very hard, and also maintaining could be an exhaustive task, so your solution, with the possibility of attaching some emulated components, would be ideal.
I started in the browser because it is an extremely simple i/o interface, so, if I succeed with the linux compile, I'll try to attach it to the browser somehow, maybe through a browser extension or something.
I'm also surprised there's nothing like I'm suggesting, as I believe could be quite handy for everyone.
Right now, my emulator works for me, as I'm trying to develop the logic around a thermostat (SSD1306, DHT22, Rotary encoder and some LEDs) and I'm not worried about constraints of the device, but that would be helpful to implement as well.
So, I'll try all those things. Thanks again!