Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype script to run DOM traversal functions on website #599

Closed
1 task
Tracked by #582
aatmanvaidya opened this issue Jul 23, 2024 · 6 comments
Closed
1 task
Tracked by #582

Prototype script to run DOM traversal functions on website #599

aatmanvaidya opened this issue Jul 23, 2024 · 6 comments
Assignees
Labels
level:feature An issue that describes a feature (initiative>feature>ticket) plugin priority:high

Comments

@aatmanvaidya
Copy link
Collaborator

aatmanvaidya commented Jul 23, 2024

  • Write a separate custom script that uses the DOM Traversal functions and works on websites.
    • inject svg icons next to slurs
    • On hovering the icon, show metadata about the slur
@hardik-pratap-singh
Copy link
Contributor

Hello @aatmanvaidya
Please assign this issue to me..

@aatmanvaidya aatmanvaidya added level:feature An issue that describes a feature (initiative>feature>ticket) plugin priority:high labels Jul 23, 2024
@aatmanvaidya
Copy link
Collaborator Author

here are few websites you could use -

(I was majorly able to find websites with very explicit slurs - still trying to find some with slur of low severity, will keep updating this from time to time)

@hardik-pratap-singh
Copy link
Contributor

Hello @dennyabrain @aatmanvaidya
I have finished writing a script which does the following

  • adding SVGs
  • show metadata on hovering
  • generates uliStore parallely

I have shared a demo video
Screencast from 25-07-24 09:34:03 AM IST.webm

@aatmanvaidya
Copy link
Collaborator Author

  • fixing some issues to get injection working on complex DOM websites (eg. Wikipedia)
  • Start integrating code in Uli Plugin.

@hardik-pratap-singh
Copy link
Contributor

I am sharing some code snippets where our script is failing

<p>
    <b>crazy</b>
    refers to craziness, or crazy Lorem, ipsum dolor. crazy
    <a href="#">
        Lorem, ipsum dolor. crazy
    </a>
    , a spectrum of behaviors crazy characterized by certain abnormal mental or behavioral patterns.
</p>
<ul>
    <li><a href="/wiki/The_Crazies_(1973_film)" title="The Crazies (1973 film)"><i>The Crazies</i> (1973 film)</a>,
        a film about a biological weapon's effects on a small town</li>
    <li><a href="/wiki/Crazy_(1999_film)" title="Crazy (1999 film)"><i>Crazy</i> (1999 film)</a>, a documentary by
        Heddy Honigmann</li>
    <li><a href="/wiki/Crazy_(2000_film)" title="Crazy (2000 film)"><i>Crazy</i> (2000 film)</a>, a film by
        Hans-Christian Schmid</li>
    <li><i><a href="/wiki/C.R.A.Z.Y." title="C.R.A.Z.Y.">C.R.A.Z.Y.</a></i>, a 2005 film by Jean-Marc Vallée</li>
    <li><a href="/wiki/Crazy_(2007_film)" title="Crazy (2007 film)"><i>Crazy</i> (2007 film)</a>, a film by Rick
        Bieber</li>
    <li><a href="/wiki/The_Crazies_(2010_film)" title="The Crazies (2010 film)"><i>The Crazies</i> (2010 film)</a>,
        a remake of the 1973 film</li>
</ul>

Identified Problem : For checking the slurWord inside an element we are doing parent.innerHTML.includes(slurWord) and injecting <span> tags across those slurWords. Now innerHTML converts everything into string be it tags inside the current element or the attribute names or class names, so attributes or class names containing the slur word also gets targetted and they also get modified.

@hardik-pratap-singh
Copy link
Contributor

hardik-pratap-singh commented Aug 15, 2024

Hello @aatmanvaidya @dennyabrain !!

From last 3 to 4 days, I was brainstorming on the above issues, today I have come up with an idea and implemented it.
We can discuss it in detail in upcoming meeting.

Sharing you a demo video of our script running on wikipedia pages
Screencast from 15-08-24 12:19:27 PM IST.webm

Code files can be accessed through this commit

@aatmanvaidya aatmanvaidya moved this from In Progress to Done in 2024 Q2 - Q3 Planner Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level:feature An issue that describes a feature (initiative>feature>ticket) plugin priority:high
Projects
Status: Done
Development

No branches or pull requests

2 participants