President Donald Trump talks with Tesla and SpaceX CEO Elon Musk at Trump Tower last February. Evan Vucci | AP

Even some of the tech industry's most prominent critics of President Donald Trump are opening their checkbooks and donating to Republican lawmakers, as Silicon Valley sets its sights on the 2018 midterm election. With the entire House on next year's ballot — and about one-third of the U.S. Senate up for a vote, too — the stakes are high for those in the Bay Area who seek to erode the GOP's control of Congress and erect a new bulwark against Trump's agenda in areas like immigration and climate change.

"These are all things right now the administration is talking about, that Republicans are talking about ... even if you don't like the other issues," said Aaron Ginn, a co-founder of the Lincoln Network, a Bay Area group that tries to connect GOP lawmakers to tech. With congressional races, the likes of Amazon, Facebook and Google always have sought to apply an even political hand. In the 2016 election, for example, these and other internet giants donated about $1.8 million to Republican campaigns, compared to $1.5 million on Democratic candidates, according to the Center for Responsive Politics. Some in the tech industry lambasted Trump as a candidate, others withdrew from the GOP convention supporting him, and still more held fundraisers for his ill-fated Democratic opponent, Hillary Clinton. But they all simultaneously sought to improve their relationships with Republicans on Capitol Hill, believing at the time — correctly — that they would retain control of Congress. In 2018, however, the midterm elections serve as a referendum on Trump's agenda. Lacking the support of friendly federal lawmakers, the president won't be able to deliver on his promises to lower corporate taxes, overhaul immigration laws, invest in U.S. infrastructure and strike new trade deals with other countries — some more problematic to the tech industry than others. Trump may already have broad executive powers to institute measures like a travel ban, and his administration long ago set out to unwind decades of federal regulations across government. But his other priorities — like efforts to scrap Obamacare, a concern to many in liberal-leaning Silicon Valley — depend nonetheless on Capitol Hill. There, GOP lawmakers got a boost earlier this year from Google's Schmidt, who donated $33,900 — the maximum contribution — to the National Republican Senatorial Committee, according to FEC records. Google's chief executive, Sundar Pichai, also wrote a $33,900 to the NRSC, federal disclosures show, but he contributed the same amount to a similar fund designed to boost Senate Democrats.