I'm sure that something along the lines of an electronic auto-dimming welding mask glass could be made to work in cockpit windows. But it'd have to be totally reliable; after all you wouldn't want it going dark by mistake, might make the landings tricky...
It would be sad if something like that became the only solution to the problem (instead of import controls, prosecution of vendors and manufacturers, policing, etc).
It's well known that pilots are getting hurt. Are there any reports on passengers and cabin crew getting hurt? I guess that side on illumination isn't going to be as steadily aimed, but would probably still be damaging.
I'm sure there are systems in the military that can pinpoint the origin of laser light. Of course, civil aviation isn't warfare so the Geneva convention does not apply; you could have automatic gun aiming/firing integrated with such a system. It could be a specific variant, e.g. 747-400-130...
Illustration of the problem
Someone I worked with was involved in buying items like laser pointers from manufacturers in a certain large Far East Asian country. At one place he was shown a selection of laser pointers, and the labels on them (an indeed the demonstration) made it quite clear that the power output was far in excess of what was safe or legal in Europe.
When he explained this to the company and said he couldn't possibly buy them, their response was "no problem, we'll change the labels". Says it all really.