Jeremy Corbyn has condemned the government’s planned legislative programme outlined in the Queen’s speech as “a farce”, as he signalled he would back a general election that could deliver a Labour government within weeks.

The Labour leader dismissed Boris Johnson’s programme for government as hollow, after the monarch read out a list of 26 bills and other ideas mainly related to Brexit, crime and the NHS.

“The prime minister promised that this Queen’s speech would dazzle us,” Corbyn said. “On closer inspection, it turns out to be nothing more than fool’s gold.

“There has never been such a farce as a government with a majority of minus 45 and a 100% record of defeat in the Commons setting out a legislative agenda they know cannot be delivered in this parliament.”

He signalled Labour was still prepared to vote for a general election as soon as the threat of a no-deal Brexit was off the table, potentially meaning it could be held in early December. Corbyn is coming under pressure from many in the party, including his own shadow cabinet, to press for a second referendum before an election.

Heckled that he had not voted for an election when Johnson tried to call one twice this autumn, he said it was essential for Johnson to “get an extension … take us away from the dangers of no deal, then we’re in a position to do that”.

He added: “We may only be just weeks away from the first Queen’s speech of a Labour government. In that Queen’s speech, Labour will put forward the most radical and people-focused programme in modern times, a once-in-a-generation chance to rebuild and transform our country.”

Responding for the government, Johnson said Corbyn could not make up his mind on whether to back an election and criticised him for changing his position on Brexit.

“His policy on cake is neither having it, nor eating it,” Johnson said. “First he was opposed to no deal, now he seems to be opposed to any deal. First he was in favour of delivering Brexit, now he wants a second referendum. First he wanted an election – actually he wanted an election for quite a long time – now he’d much rather not.

“He resembles a Janus. A push-me-pull-you facing both directions at once and yet unable to decide for either.”

Johnson dismissed criticism of his Queen’s speech, saying it was a programme for “an open, global, free-trading United Kingdom”.

More than a third of the new bills announced by the Queen relate to arrangements to be made after Britain’s departure from the EU.

Other key elements of a speech widely trailed in advance included plans for tougher jail sentences – one of seven bills devoted to law and order, a direction that has prompted alarm from prison reform charities – and proposals to oblige people to show photographic ID before they are allowed to vote.

On Brexit, Corbyn said the government had had “three and a half years to get Brexit done and they’ve failed”.

He said the prime minister’s speech “was supposed to herald an end to austerity and a new vision. Instead it barely begins to unpick the devastating cuts to public services.”

Corbyn condemned plans to increase sentences for violent offenders, saying judges already had the necessary powers.

He concluded: “This legislative programme is a propaganda exercise that cannot disguise that this government has failed on Brexit for over three years, that they are barely beginning to undo the damage of a decade of cuts to our public services, that it does nothing for people struggling to make ends meet, does nothing to make our world a safer place or tackle the climate emergency.”

On another primary election battleground, health, the main measure outlined was not legislative but a proposal for a new long-term plan for the NHS. On social care, there was a proposal for a consultation.

A series of other bills outlined by the Queen have either already been before parliament or been discussed in depth, for example on domestic abuse, no-fault divorce, a measure to oblige restaurants and other businesses to pass on all tips to staff and tougher regulations on fire safety in high-rise buildings in response to the Grenfell Tower disaster.

Other pledges for future bills covered areas also likely to feature strongly in the Conservative election manifesto, such as increased schools funding and more free schools, legislation intended to help the rollout of faster broadband and an environment bill outlining post-Brexit policies in areas including plastic, biodiversity and air quality.

The Queen’s speech will be debated by MPs for several days but is unlikely to be approved by parliament, given Johnson’s lack of a majority in the Commons. However, his official spokesman said he would not resign if he were to lose the formal vote on it next week.

“He is committed to delivering on his domestic agenda, as well as delivering Brexit. If MPs do choose to vote against the Queen’s speech, it will be for them to explain to the public why they are voting against greater support for our public services, for the police, schools and hospitals; why they are blocking legislation that would lead to serious and dangerous offenders spending more time in prison; and why they are standing in the way of significant infrastructure improvements.”

In an attempt to show that it is determined to press ahead with its legislative agenda, the government will table seven bills on Tuesday including on the environment, animal welfare and pensions.