refactor: remove the unused URL shortener
buildChatGptUrl and its fitToBudget helpers have had no production caller since prepareAction took over routing; the 2026-10-05 plan kept them only for existing tests until then. They also shortened silently, against the ask-before-shortening rule, so they were a trap to reuse. Port the tests that guard live code onto applyTemplate and serializePrompt, including the $&, $`, $' and $$ regressions (checked to fail against the string-replacement form), and cover prepareAction's whole-word cut, which nothing tested before. Also drop getContext's inputType password check. menus.OnClickData has no inputType, so it never fired; Firefox already withholds password fields from selectionText via mozIsTextField(true) in SelectionUtils (bug 565717). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,6 @@ test('context prioritizes selection over link and excludes unrelated targets', (
|
||||
assert.deepEqual(actions.getContext({selectionText:' ',linkUrl:'https://example.com'}), {kind:'link',source:'https://example.com'});
|
||||
assert.equal(actions.getContext({mediaType:'image',pageUrl:'https://example.com'}), null);
|
||||
assert.equal(actions.getContext({editable:true,pageUrl:'https://example.com'}), null);
|
||||
assert.equal(actions.getContext({selectionText:'secret',inputType:'password'}), null);
|
||||
assert.equal(actions.getContext({pageUrl:'https://example.com'}).kind, 'page');
|
||||
});
|
||||
test('selection actions and optional translation reflect settings', () => {
|
||||
|
||||
Reference in New Issue
Block a user