Introduction: Roving histopathological imaging in the navigation-confirmed tumor negative margin has not been achieved during neurosurgery procedures. This study aims to explore the diagnostic values of a novel intraoperative handheld endomicroscopy DiveScope (DS) for ex vivo glioma diagnosis and in vivo roving scan in navigation-confirmed glioma negative margin and to evaluate its safety. Materials and Methods: This prospective pilot study was conducted at [university/hospital name] from October 2021 to October 2023, and enrolled patients scheduled for glioma resection surgery. The diagnostic values of DS scanning were compared with the frozen section (FS). Hematoxylin-eosin (HE) staining was used as the gold standard for evaluation. The medical device adverse events (MDAE) were recorded for safety analysis. Results: The previous 24 patients with 73 intraoperative isolated samples were included in the DS ex vivo assessments for glioma diagnosis, and the subsequent 40 patients with 52 samples were included in the DS in vivo assessments for navigation-confirmed tumor negative margin. The sensitivity, specificity, and accuracy of DS scanning were 100.0%, 81.6%, and 90.4% for ex vivo assessment by a pathologist, 100.0%, 76.3%, and 87.7% for ex vivo assessment by a neurosurgeon, and 100.0%, 85.0%, and 94.2% for in vivo assessment, respectively. DS in vivo roving scan showed a significantly improved area under the receiver-operating characteristic curve (AUC) compared to FS in assessing the navigation-confirmed tumor negative margin (AUC: 0.925 vs. 0.725, P = 0.003). There were no MDAEs. Time consuming for DS scanning for each sample was 75.77 ± 45.03 s and for each patient was 121.63 ± 94.04 s. Conclusion: DiveScope could provide safe, time-effective, and accurate roving histological imaging for navigation-confirmed glioma negative margin during surgery, which may guide the glioma resection process to achieve maximal safe resection and promote prognosis.