French lawmakers want Google to give up its search code.

The country's senate voted last week to require search companies to hand over access to their search algorithms to ensure that rivals are treated fairly. The search companies would also have to post links to three competitor search engines on their search results pages.

The penalty for noncompliance: 10% of global profits.

Though the law would apply to all search engines, it is clearly aimed at Google (GOOGL) -- the company has a 90% share of the search market in France.

"We're transparent about what ranks well on Google, including when we make changes, but by definition, not everyone can come at the top of the rankings," said Google spokeswoman Caroline Matthews. "Revealing our algorithms - our intellectual property - would lead to the gaming of our results, which would be a bad experience for users."

The bill is unlikely to become law, because the government of President François Hollande is opposed to it. It was introduced as an amendment to a bill designed to grow the French economy that reportedly will go up for a wider vote in France's National Assembly later this month. A preliminary version of the amendment was declared unconstitutional, before it was tweaked.

The vote came just a day after the European Union filed serious antitrust charges against Google. The search company faces a fine of up to $6 billion -- more than a quarter's worth of profits. It also could have to change the way it displays search results in the EU.

It's just the latest in a string of unfavorable rulings for Google in Europe.

Last year, the European Parliament voted in favor of a nonbinding resolution to break up the company. Parliaments in Spain, France and Germany passed laws that allow publishers to charge Google when snippets of their stories land in Google News -- and the news service shut down in Spain as a result. And Google lost its battle over the "right to be forgotten," a European law that requires the company to remove certain unwanted, inappropriate links from search results if requested.

Google is particularly protective of its search algorithm -- the secret sauce that helped propel the company to search dominance over the past decade. If the bill passes and Google opts not to share its algorithm, it might consider ceasing operations in France. Google's search engine would still be available in France, but its servers would be located in another country.

It would be an extreme measure that the company has so far reserved for China. In 2010, Google removed its servers and business from mainland China, placing them in Hong Kong instead. That allowed Google to provide the Chinese with search results without the onus of censoring the results according to Chinese law (the Chinese government now censors the results themselves).