Sanya Iframe Breaker a Shafin ka

mai karya iframe

Abokina mai kyau Kevin Mullett ya sanar da ni lokacin da ya danna ɗayan hanyar haɗin yanar gizo na a cikin Twitter, an kawo shi zuwa rukunina tare da babban popup da kuma mummunan gargaɗin lamba. Wannan ya isa ya tsoratar da tunanin wani, don haka sai na fara yin gwaji. Tana iska babu wani abu da ya dace da shafin na - matsalar ita ce hanyar haɗi.

Hanyar haɗin yanar gizon a wani shafin ya samar da kayan aiki a saman wanda ke ƙarfafa mutane su danna maɓallin haɗi, yayin ɗora shafin na a cikin wani iframe a ƙasa. Ga mafi yawan masu goyon baya, yana iya bayyanar da cewa rukunin yanar gizan na na yada muguwar lamba. A gaskiya, ina wulakanta duk wani shafi da yake loda shafin a cikin iframe, don haka nayi abinda kowane gwani zai yi… Na loda abin fashewa.

Lambar mai sauki ce. Sanya lambar layi mai zuwa a cikin ɓangaren shugaban shafinku:

if (top !== self) top.location.href = self.location.href;

Lokacin da shafin ya loda tare da firam ɗin kayan aiki, Javascript yana aiwatarwa kuma idan shafinku baya ɗaukar duk masarrafar, a zahiri yana tura shafin don zama shafin a cikin mai binciken. Kyakkyawan da sauƙi - kuma babu ƙarin haɗarin kamawa a cikin wasu maɓallin kayan aiki mara kyau!

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.