We designed a novel hydrazone covalent organic framework (COF) and developed a polydopamine (PDA) method to immobilize COF on a stainless steel fiber for headspace solid-phase microextraction (HS-SPME). A series of characterization studies was performed to validate the structure and property of the prepared fiber. The COF-PDA fiber was applied for the extraction of pyrethroids coupled with gas chromatography equipped with an electron capture detector (GC-ECD). Under the optimum experimental conditions, high enhancement factors of 307-2327 were achieved, indicating that the hydrazone COF possessed good extraction efficiency for pyrethroids. The detection limits ranged from 0.11 to 0.23μgkg(-1) with relative standard deviations varying in the range of 3.6-9.2% (intra-batch) and 6.9-12.1% (inter-batch), respectively. The developed method was applied to the determination of pyrethroids in fruit and vegetable samples and the accuracy was assessed through recovery experiments.