Catalyzes the oxidation of β-D-glucose to D-glucono-ω-lactone and hydrogen peroxide. Also catalyzes the conversion of D-glucono-ω-lactone to gluconic acid.