Two dimensional (2D) materials exhibit superior properties in electronic and optoelectronic fields. The wide demand for high performance optoelectronic devices promotes the exploration of diversified 2D materials. Recently, 2D covalent organic frameworks (COFs) have emerged as next-generation layered materials with predesigned pi electronic skeletons and highly ordered topological structures, which are promising for tailoring their optoelectronic properties. However, COFs are usually produced as solid powders due to anisotropic growth, making them unreliable to integrate into devices. Here, by selecting tetraphenylethylene (TPE) monomers with photoelectric activity, we designed and synthesized photosensitive 2D COFs with highly ordered topologies and grew 2D COFs in situ on graphene to form well ordered COF graphene heterostructures. Ultrasensitive photodetectors were successfully fabricated with the COFETBC TAPT graphene heterostructure and exhibited an excellent overall performance. Moreover, due to the high surface area and the polarity selectivity of COFs, the photosensing properties of the photodetectors can be reversibly regulated by specific target molecules. Our research provides new strategies for building advanced functional devices with programmable material structures and diversified regulation methods, paving the way for a generation of high performance applications in optoelectronics and many other fields.