"by chance; perhaps," late 14c., hapliche, from hap + -ly (2).
Entries linking to haply
hap n.
c. 1200, "chance, a person's luck, fortune, fate;" also "unforeseen occurrence," from Old Norse happ "chance, good luck," from Proto-Germanic *hap- (source of Old English gehæp "convenient, fit"), from PIE *kob- "to suit, fit, succeed" (source also of Sanskrit kob "good omen; congratulations, good wishes," Old Irish cob "victory," Norwegian heppa "lucky, favorable, propitious," Old Church Slavonic kobu "fate, foreboding, omen"). Meaning "good fortune" in English is from early 13c. Old Norse seems to have had the word only in positive senses.
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.