Driver debug

hi ,
i have a problem, i am trying to accomplish a goal, you see there is a function in most browsers that allow websites to see your Battery level, which makes it easy to track the user, i am trying to achieve that by faking the battery level like random value each 5 min. Anyway there is the way of injecting the javascript via chrome extension, but that may not work with other browsers like Microsoft edge.
So the way that is left is either to hook the method which asks for the battery level and give a fake read, or change the driver file cmbatt.sys which will make it easy to build an interface the simulate the battery level. I looked everywhere i could reach but in vain. Please help me i think this will be very easy for you,Thank you a lot!