The invention belongs to the technical field of computers, and discloses a browser extension universal
code generation method which comprises the following specific steps: step 1, environment building and project dependent installation: a developer firstly needs to install a project dependent environment, including installing decompressed extension
directory extension in a browser; firstly, a
Manifest file is standardized through tools such as WebExtension Manifest Format and the like, correct loading and explanation of expansion in various browsers can be ensured, development efficiency and user experience are improved, secondly, a Babel
library and a Polyfill
library are adopted for
processing the
JavaScript compatibility problem, a developer can use the latest language characteristic trustingly, compatibility does not need to be worried, iteration and updating of the technology are promoted, and meanwhile, the development efficiency is improved. Compared with the prior art, the webpage-polyfilter
library simplifies the complexity of calling the API of the browser, so that the cross-browser development becomes simpler and more unified, the use of the Autoprefix tool can automatically add the browser prefix for the CSS, the manual
workload of a developer is effectively reduced, and the development efficiency is improved.