Legislation aimed at preventing foreign interference and constraining the influence of big money in Canadian elections has been approved by the Senate.

Bill C-76 passed in the upper house late Monday on a vote of 54-31 and is expected to receive royal assent later this week.

That means the reforms will apply during next year’s federal election campaign.

Story continues below advertisement

Chief electoral officer Stephane Perrault had warned that the much-delayed bill must go into effect by the end of this year if the independent elections watchdog was to have time to implement the reforms for next year’s campaign.

Bill C-76 is an omnibus bill that will reverse a number of changes wrought by the previous Conservative administration’s widely denounced Fair Elections Act. It will restore the use of voter information cards as a valid form of identification to prove residency and will do away with measures that critics argued were designed to benefit the deep-pocketed Tories.

It will limit spending by parties and advocacy groups during the three-month period before an election is officially called, as well as during the official campaign. And it scraps a Tory-instituted provision allowing parties to spend $650,000 for each day a campaign exceeds the minimum 37 days and caps the maximum campaign length at 50 days.

It will also extend the right to vote to ex-patriate Canadians, no matter how long they’ve lived outside the country, rather than the current five-year limit.

The bill represents a first stab at grappling with the spectre of social media being abused by bad actors – foreign or domestic – to manipulate election results, exacerbate societal divisions, amplify hate messages or instill distrust in the electoral system. It comes in the wake of scandal over Russian interference in the last U.S. presidential contest and the misuse of personal information of millions of Facebook users during the United Kingdom’s Brexit campaign.

It will ban advocacy groups from ever using money from foreign entities to conduct partisan campaigns.

And it will require online platforms, such as Facebook and Google, to create a registry of all digital advertisements placed by political parties or third parties during the pre-writ and writ periods and to ensure they remain visible to the public for two years.

Story continues below advertisement

The bill requires political parties to put in place and publish policies designed to protect the privacy of Canadians whose personal information winds up in their massive voter data bases. But there will be no requirement for independent monitoring or enforcement of those policies.

The legislation also beefs up the powers of the commissioner of elections to investigate violations of election laws, including giving the commissioner the power to compel testimony.

Conservative senators proposed four amendments to the bill Monday but all were defeated.

They have been particularly critical of the provision allowing millions of Canadian citizens living abroad to cast ballots, some of whom Conservatives have argued might potentially be compelled to vote a certain way by unfriendly foreign governments.

Although some two million Canadians live outside the country, Perrault has estimated that only about 30,000 ex-pats will actually take advantage of the right to cast ballots.