An Indian actress who introduced the vibrator to Hindi cinema has become the latest target for the country’s notorious Twitter trolls. And she is loving it.

Swara Bhasker’s own bio on Twitter describes her as “an armchair activist, Twitter warrior, troll destroyer, right-wing baiter, liberal hysteric”. The candour is admirable – and the bio is accurate.

Consider a recent instance involving her latest film, Veere di Wedding. Though it is a commercial movie with star power (the actresses Kareena Kapoor and Sonam Kapoor play major roles), it is distinguished by the absence of a male lead and its focus on women’s concerns.

Pakistan’s forbidden romance with Bollywood

Bhasker plays a spoilt, rich girl married to a man unable to sexually satisfy her. She turns to a vibrator and in one of the film’s most talked about sequences, pleasures herself. (This is Hindi cinema so there is no actual nudity; only the suggestion of self-gratification.)

Shortly before the film was released, right-wing activists urged viewers to boycott it. The call for the boycott was not prompted by the vibrator scene but by another controversy. Some months ago, after a rape was reported inside a temple, Bhasker and other stars took part in a campaign to protest against rapes. Hindu activists treated this as an insult to Hinduism and some denied that any rape had taken place in the temple.

In the event, hardly anyone boycotted the film. It took one of the biggest box office openings ever for a film without a male star, making it the surprise hit of the summer.

But by then, the trolls had begun to focus on the masturbation scene. One tweeted that he had taken his grandmother to see the film and that she had been appalled. Exactly the same tweet, with the same wording (down to the misspelling of the word masturbation) appeared again and again on Twitter, being posted with a variety of different handles, with each user pretending that this was their own experience. The obvious cut-and-paste tweeting campaign soon became the subject of endless jokes on social media and fodder for stand-up comedians. In the process, the trolls gave the film the kind of publicity that money could not have bought.

Swara Bhasker on social media trolls

The controversies may have shaken a more timid person but Bhasker, as befits a woman who calls herself a “troll-destroyer”, is amused by the furore. She did not back down even when trolls launched a campaign to boycott Amazon (and to delete the app from their phones) for associating with Bhasker. To its credit, Amazon held firm – on previous occasions, right-wing trolls have succeeded in getting online companies to drop such stars as Aamir Khan. All this makes Bhasker something of a rarity in Indian cinema.

She was born into a reasonably well known Delhi family. Her father, who retired as a commodore in the Indian navy, is one of the country’s leading defence experts and appears frequently on television while her mother is a professor of cinema. Bhasker went to Jawaharlal Nehru University, regarded as a bastion of left-wing thought but her politics were essentially centrist and she is clear that she is not a Marxist.

Meet the Secret Superstar of China, from India: Aamir Khan

Her desire to fight the right-wing, she says, comes not from any revolutionary zeal but from her own sense that India is going through a dangerous phase where the liberal values enshrined in the constitution are being trampled on. “We live in surreal times”, she says. “We live in times when people can burn somebody alive, film the act and then post the video on social media.”

She accepts that discrimination against India’s religious minorities is not new and that lower castes have often been mistreated in India. But, she argues, what is new is the complete lack of shame that now accompanies such discrimination and violence.

“There was a time when people who were prejudiced might express those prejudices in private. But now they go on TV and declare them openly. There is no shame any longer. People are not even embarrassed to defend rapists,” she says. “We have to stand up for the values written in our constitution.”

The Hindi film business has long been one of India’s most secularly united industries with no distinction being made between Hindus and Muslims. Nor is caste a factor; most people in the business are not even aware of each other’s caste. And there is some history of activism. The award-winning actress Shabana Azmi fasted in public in the 1980s to prevent a slum colony from being demolished.

Rajinikanth: The Tamil star who has a cult following in … Japan

So Bhasker’s positions are not entirely unprecedented. But what makes them different is that she speaks not from a radical or Marxist perspective but from a position of old-fashioned liberalism. Moreover, she takes these stands in a social media age where Twitter mobs or WhatsApp lynch groups can easily be deployed to threaten and intimidate any target, especially one as high-profile as Bhasker. Often, the intention is to cut off the target’s livelihood by threatening sponsors and advertisers with boycotts and by encouraging viewers to stay away from films so that they flop.

So far at least, the film industry and sponsors have taken these threats seriously. Bhasker is one of the few stars to refuse to be cowed and to do battle with the trolling mobs.

The importance of Veere di Wedding’s box-office success is that it shows that no matter how virulent a hate campaign on social media is, stars and filmmakers can still flourish if they have the guts to fight back. Perhaps others will take courage from this example.

As for Bhasker, she is now even more determined to take on the trolls. As her Twitter bio says, she is a “liberal hysteric”. And sometimes hysteria in the defence of liberty is not such a bad thing.