Zach Gibson/Getty Images

Democrats in the Senate introduced an internet-focused "privacy bill of rights" Tuesday ahead of Facebook CEO Mark Zuckerberg's testimony on Capitol Hill.

The so-called CONSENT Act (PDF) would require the Federal Trade Commission to establish privacy protections for people who use online platforms, like Facebook and Google. (CONSENT stands for Customer Online Notification for Stopping Edge-provider Network Transgressions.) Sens. Edward Markey of Massachusetts and Richard Blumenthal of Connecticut say that if passed, the legislation would protect the personal information of American consumers.

Markey and Blumenthal introduced the legislation ahead of Zuckerberg's much anticipated testimony before a joint hearing of the Senate Judiciary and Commerce Committees. Observers expect the CEO to talk about online privacy and data protection in the wake of the Cambridge Analytica scandal. Cambridge Analytica, a political consultancy with ties to the Trump presidential campaign, obtained data on up to 87 million Facebook users without their permission.

Sen. Markey said the time for regulations has come so consumers can be assured companies like Facebook are protecting their data.

"Voluntary standards are not enough," Markey said in a statement. "We need rules on the books that all online companies abide by that protect Americans and ensure accountability."

Specifically, the law would require that companies like Facebook and Google obtain opt-in consent from users before sharing, selling or otherwise using their personal information. It would also require that these companies develop reasonable data security practices, notify users about all collection use and sharing of their personal information, and notify users in the event of a security breach.

"The startling consumer abuses by Facebook and other tech giants necessitate swift legislative action rather than overdue apologies and hand-wringing," Sen. Blumenthal said in a statement. "Consumers deserve the opportunity to opt in to services that might mine and sell their data -- not to find out their personal information has been exploited years later."

When asked during the hearing about whether he would support a law that required users to opt in before their data is shared or used in targeted advertising, Zuckerberg said yes "in principle." But he added that the details matter. He committed to working with Sens. Markey and Blumenthal on working out the details.

Last month, Markey and Blumenthal sent a letter to Zuckerberg asking a series of questions regarding Facebook's involvement in the collection of its users' personal data and requesting that he testify on the matter before the Senate Committee on Commerce, Science, and Transportation.

In an interview with National Public Radio on Monday, Blumenthal said Zuckerberg will have to do more than apologize to satisfy him and other lawmakers. He compared the situation that Facebook faces with what the auto industry went through in 1965 following the publication of consumer advocate Ralph Nader's book that pushed carmakers to spend money to introduce safety features like seat belts into cars.

"The company really is at a moment of reckoning," Blumenthal said. "It is comparable to what the automobile industry faced at Unsafe at Any Speed. The question is one of responsibility for individual data, and it goes well beyond Cambridge Analytica."

First published April 10, 11:58 a.m. PT

Update, 2:47 p.m.: Adds comments from the Senate hearing.

Cambridge Analytica: Everything you need to know about Facebook's data mining scandal.

iHate: CNET looks at how intolerance is taking over the internet.